Delete by query

Call this API to execute a search query and delete the document found:

Parameters:

curl -XPOST -H 'Content-Type: application/json' -d @my_payload \
    "http://localhost:9091/indexes/my_index/search?delete=true"

Where the payload file (my_payload) contains the search request:

{
  "query": {
    "type": "FacetPathQuery",
    "dimension": "category",
    "path": [
      "cat4"
    ]
  }
}

Response

The API returns the number of deleted documents.

{
  "total_hits" : 3
}