How to Search and Delete Specific Documents in Elasticsearch [curl Edition]
I’ll introduce how to search and delete specific documents in Elasticsearch using curl.
I wanted to delete specific documents in Elasticsearch using curl, so I researched and practiced it.
Search API | Elasticsearch Guide [7.x] | Elastic
curl \\
-H "Content-Type: application/json" \\
-XPOST \\
"$ES_HOST/products/_search" \\
-d '{ "query": { "match": { "id": "1" } } }'
Delete by query API | Elasticsearch Guide [7.x] | Elastic
curl \\
-H "Content-Type: application/json" \\
-XPOST \\
"$ES_HOST/products/_delete_by_query" \\
-d '{ "query": { "match": { "id": "1" } } }'
That’s all from the Gemba.