I have the following function to remove document from index:
async deleteDocument (indexName: string, id: string) {
const indexExist = await this.isIndexExists(indexName)
if (indexExist) {
return this.client.delete({ index: indexName, id })
}
return Promise.resolve()
}
When I console.log() the response from this function it returns elastic response saying that deletion was successful. However, when I check in Kibana, the deleted document is still in place even after a few hours of waiting.
I tried to use refresh set to true and wait_for, but that seems to have no effect on a result as well.
What could be wrong with the function and how can I fix it?