1 删除
POST /zy/_delete_by_query
{
"query": {
"terms": {
"id": [
]
}}
}
2根据某个字段的值查询
GET /zy_0817/_search
{
"query": {
"terms": {
"kv.theme.value": [
"17698340984"
]
}
}
}
GET /zy_0817/_search
{
"query": {
"match": {
"dmID": "19036"
}
}
}
3根据时间查询
GET /zy_0817/_search
{
"query": {
"bool": {
"filter": [
{
"term": {
"dmID": "19036"
}
},
{
"range": {
"sysLastmodified": {
"gte": 1559750400000,
"lte": 1559836800000
}
}
}
]
}
}
}
4es-sql查询
GET _xpack/sql
{
"query":"select kv.fosState.value,count(*) from zy where dmID =10 group by kv.fosState.value"
}
将sql语句翻译成es语句
GET /_xpack/sql/translate
{
"query":"select kv.fosDesc.value ,kv.resname.value from zy where dmID =7 and id =950101"
}
5 es查所有数据
GET /zy_event/_search
{
"query":{
"match_all":{}
}
}