elasticsearch常用查询语句

复制索引数据到另外一个索引中:

POST _reindex
{
“source”: {
“index”: “ihr-baseinfo”
},
“dest”: {
“index”: “songmingqi-test”
}
}

删除索引中全部数据:
POST songmingqi-test/baseinfo/_delete_by_query?conflicts=proceed
{
“query”: {
“match_all”: {}
}
}

根据条件删除索引中的数据:

GET ihr-exammaster-*/_delete_by_query
{
“query”: {
“match”: {
“card_no”: “D”
}
}
}

去重:
GET test-songmingqi/baseinfo/_search
{
“query”: {
“bool”: {
“must”: [
{“match_all”: {}}
]
}
},
“from”: 0
, “size”: 20,
“aggregations”:{
“COUNT(distinct(xman_id))”:{
“cardinality”: {
“field”: “(xman_id)”
}
}
}

}
 

猜你喜欢

转载自blog.csdn.net/h952520296/article/details/86291057