常用操作
查询所有数据
POST http://192.168.97.173:27009/logstash_test_2018/doc/_search
{ "query": { "bool": { "must": [ { "match_all": { } } ], "must_not": [ ], "should": [ ] } }, "from": 0, "size": 20, "sort": [ ], "aggs": { } }
根据条件查询
POST http://192.168.97.173:27009/logstash_tower-lihang_2018/doc/_search
{ "query": { "bool": { "must": [ { "wildcard": { "weight.keyword": "互*网" } } ], "must_not": [ ], "should": [ ] } }, "from": 0, "size": 10, "sort": [ ], "aggs": { } }
更新数据
PUT http://192.168.97.173:27009/logstash_tower-lihang_2018/doc/cqXKaWQBCaAmlugIjMEd(这是ID)
{ "windSpeed": "0" }
根据id删除数据
POST http://192.168.97.173:27009/logstash_tower-lihang_2018/doc/_delete_by_query
{ "query": { "match": { "_id": "VqZhd2QBCaAmlugIeMZQ" } } }
根据某字段排序
POST http://192.168.97.173:27009/logstash_tower-lihang_2018/doc/_search
{ "query": { "bool": { "must": [ { "wildcard": { "weight.keyword": "互*网" } } ], "must_not": [ ], "should": [ ] } }, "from": 0, "size": 10, "sort": {"dateTime":{"order": "desc"}}, "aggs": { } }