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.
<== 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?
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?
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?
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.
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.