Replace the match_all
query with any query that you would like.
POST /products/_update_by_query
{
"script": {
"source": "ctx._source.in_stock--"
},
"query": {
"match_all": {}
}
}
The conflicts
key may be added as a query parameter instead, i.e. ?conflicts=proceed
.
POST /products/_update_by_query
{
"conflicts": "proceed",
"script": {
"source": "ctx._source.in_stock--"
},
"query": {
"match_all": {}
}
}
GET /products/_search
{
"query": {
"match_all": {}
}
}