Why elasticsearch automatically creates an index if it has not been created before delete operation?

I have confused about the description about the delete API that the delete operation automatically creates an index if it has not been created before. But i tried to execute the delete an unexisting index operation, the elasticsearch response error directly and I didn't see that index has been created. Is there any one know this question. If it really works in that way,why did the delete operation create the index at first?

I just tried and it does not do this behaviour;

$ curl -XDELETE 0:9200/testindex
{"error":{"root_cause":[{"type":"index_not_found_exception","reason":"no such index","resource.type":"index_or_alias","resource.id":"testindex","index_uuid":"_na_","index":"testindex"}],"type":"index_not_found_exception","reason":"no such index","resource.type":"index_or_alias","resource.id":"testindex","index_uuid":"_na_","index":"testindex"},"status":404}

I tried to delete an unexisting index and got the same response as you,so I doubt about that description of official doc which as follows
why delete an unexisting index will create it .It dosen't make any sense....

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