json - Elasticsearch delete-by-query returns success but records persist? -
i attempting delete records elasticsearch using delete query api
executing:
curl -xdelete localhost:4040/search/foo/_query -d '{ "term": { "record id": "0f9eaa6f-90bb-4dee-9ecb-78a5d04719c0" } }'
results in:
{ "ok": true, "_indices": { "foo": { "_shards": { "total": 5, "successful": 5, "failed": 0 } } } }
yet, querying:
curl -xget localhost:4040/search/foo/_search -d '{ "query": { "match": { "record id": "0f9eaa6f-90bb-4dee-9ecb-78a5d04719c0" } } }'
gives me:
{ "took": 2, "timed_out": false, "_shards": { "total": 5, "successful": 5, "failed": 0 } }
with 5 records printed...
i have tried running:
curl -xget localhost:4040/search/foo/_refresh
but still results returned?
you deleting using term
query , searching using match
query. these 2 different queries. term
query doesn't analyze supplied query term while match
does. these 2 queries may produce different results depending on how record id
field analyzed.
Comments
Post a Comment