Friday 2 October 2015

Elasticsearch: check document exist or not

Some times you want to check whether document is present in the index or not. In that case you use HEAD request. HEAD returns status code ‘200 OK’ if document exist, else ‘404 Not Found’.

For the url ‘http://localhost:9200/xyz/employees/1’.

For the url ‘http://localhost:9200/xyz/employees/5’.


Note:

I used chrome Advanced REST client plugin here.


Prevoius                                                 Next                                                 Home

No comments:

Post a Comment