Bug report for Documents API

When deleting a document by ID the API falsely suggests that the document was not deleted whereas it has, in fact, been deleted.

Given the following document:

[
  {
    "id": 1,
    "name": "Apple pie"    
  }
]

The query to delete the document with a numeric ID is executed as follows. Notice that the document ID is written as a number and not as a string.

curl -X DELETE 'https://[instance id].ent-search.[region].[provider].cloud.es.io/api/as/v1/engines/national-parks-demo/documents' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx' \
-d '[1]'

The response (HTTP 200) suggests that the document was not deleted:

[
  {
    "id": 1,
    "deleted": false
  }
]

However, the document does, in fact, get deleted.

Altering the delete request to include the document ID as a string "1" instead of a number 1 performs as expected.

Nice catch @zkirill! I created a ticket in the corresponding repo. Thank you for reporting!

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.