POST products_dev/_update_by_query
{
"script" :
{
"source": "ctx._source.ranking=9999;"
},
"query":
{
"term" :
{
"ranking": 0
}
}
}
Duplicate find by grouping:
GET /operators_circles/_search { "size": 0, "aggs": { "duplicate_documents": { "terms": { "script": { "source": "doc['operator_code.keyword'].value + '|' + doc['circle_code.keyword'].value" }, "min_doc_count": 2, "size": 10 }, "aggs": { "docs": { "top_hits": { "size": 10 } },
"having": { "bucket_selector": { "buckets_path": { "count": "_count" }, "script": { "source": "params.count > 1" } } } } } } }