How to check if an index exists over HTTP?


(ajsie) #1

I wanna create a new index if it doesn't already exist.

How can I check that?


(Shay Banon) #2

You can use curl -XHEAD localhost:9200/test where test is the name of the
index. It will return 404 status if it does not exists, and 200 if it does.

On Sat, Jul 23, 2011 at 10:14 PM, johnnywengluu
johnny.weng.luu@gmail.comwrote:

I wanna create a new index if it doesn't already exist.

How can I check that?

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/How-to-check-if-an-index-exists-over-HTTP-tp3194041p3194041.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.


(system) #3