where =foo in my case. I'm not expecting this exception to be thrown. The operation should silently complete.
I'm using version 1.7.2 of elasticsearch.
I'm wondering if this is a genuine bug or if the documentation is not up-to-date.
If someone else could check this on their installation that would be appreciated.
All you need to do is execute these queries for an index you know does not exist.
POST /indexname/_close?ignore_unavailable=true worked fine for me. The 404 seems to indicate that the index you are trying to close doesn't exists though, can you check via _cat/indices?
I know that the index does not exist. This post if all about the behaviour I would expect in the case that the index does not exist.
The point is that I would not expect the exception to be thrown when ignore_unavailable=true but I would expect it to be thrown when ignore_unavailable=false.
What do you mean by 'worked fine' when you did your test? If you got a 404 then I would say it did not work fine.
Ah, ok, that explains why it's not working as I expect. This means the documentation is misleading since it says the following:
"An error will be thrown if the request explicitly refers to a missing index. This behaviour can be disabled using the ignore_unavailable=true parameter"
I've noticed that when using the restore command that ignore_unavailable=true behaves as I expect. This means that I can restore a snapshot even if all my indexes are missing and it will not throw an exception. This is why I was expecting similar behaviour for close command with the same option setting.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.