Search includes closed index => ClusterBlockException

I am using elasticsearch api for searching indexes. Several physical
indexes are bound to an alias and the java client simply uses the alias to
search in all indexes. This works if any referenced index is available, but
it causes an ClusterBlockException if one of the physical indexes is
closed. I tried to advise ES to ignore closed indexes, but it does not work
as I expected.

  SearchRequestBuilder srb = esClient.prepareSearch(this.indexName);  

<== alias name bound to several indexes
srb.setIndicesOptions(IndicesOptions.strictExpandOpenAndForbidClosed
());
String json = getJsonQuery();
srb.setSource(json);
SearchResponse sr = srb.execute().actionGet(); <== Causes
ClusterBlockException

How to advise ES to ignore closed/unavailable indexes? I tried several
options from IndicesOptions.<...>, but none of them does the expected. Are
there best practices?

regards,
markus

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/79ad34b2-e78c-424d-93f0-8de8cf215d24%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Any idea how to handle closed indexes? My understanding of closing an index
is, to remove it from searching without physically deleting it. When
working with aliases a closed index causes an cluster blocked exception.
How can I avoid this?

The IndicesOptions looks like that, but they do not work with an index
alias. Seems they work with wildcards. Basically what is the concept of
closed indexes?

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/adb27d12-f609-4225-a49c-dec4abdb09c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Closed indexes are used if you still want the data but not taking up heap,
eg for long term archive still in the cluster.

On 4 February 2015 at 20:50, msbreuer@gmail.com wrote:

Any idea how to handle closed indexes? My understanding of closing an
index is, to remove it from searching without physically deleting it. When
working with aliases a closed index causes an cluster blocked exception.
How can I avoid this?

The IndicesOptions looks like that, but they do not work with an index
alias. Seems they work with wildcards. Basically what is the concept of
closed indexes?

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/adb27d12-f609-4225-a49c-dec4abdb09c2%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/adb27d12-f609-4225-a49c-dec4abdb09c2%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAEYi1X8XWwzaBz8khD6zBEYV%2BUuDaUUjn9-pgQYJqsoYHpvw_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Closed indexes are used if you still want the data but not taking up heap,
eg for long term archive still in the cluster.

That is still what I expected. A closed index remains on hard disk and
cannot be queried. But I also expected such indices to be ignored by
queries, even if they are referenced by an alias. Currently closing an
index makes the alias unusable. The application itself has to determine all
referenced indexes and to filter out the closed ones.

Are there reasons why ES doesn't filter them? Also java and json api offer
such filters, but they won't work for an alias. Seems they only work for
index wildcards, but this is different from using an alias.

regards,
markus

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/77d88834-94f6-43a1-b71c-ae0bd7a7928a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.