Up through ES 1.1.1 the following Java snippet was able to take an array of
one or more index specifications (e.g. test*, ix*, sgen) and create a list
of index names that match (e.g. test1, test2, test3, ix1, ix2, sgen):
/* Create array of 1 or more index specifications */
String[] indexSpecList = parseIndex(indexPattern);
/*
- Get the list of individual index names, along with their status
- information (which we will ignore in this method)
*/
IndicesAdminClient iac = client.admin().indices();
IndicesStatusRequestBuilder isrb = iac.prepareStatus();
isrb.setIndices(indexSpecList);
IndicesStatusResponse isr = isrb.execute().actionGet();
/* Create an array of just the names of the indices */
ArrayList indices = new ArrayList();
Map<String, IndexStatus> ismap = isr.getIndices();
for (String index : ismap.keySet())
{
indices.add(index);
}
But in ES 1.2, the following classes are deprecated (and therefore result
in Javac build warnings which mean that someday these APIs may vanish).
import org.elasticsearch.action.admin.indices.status.IndexStatus;
import org.elasticsearch.action.admin.indices.status.
IndicesStatusRequestBuilder;
import org.elasticsearch.action.admin.indices.status.IndicesStatusResponse;
What is the new recommendation for getting a list of the index names that
match a pattern? Would someone kindly point me to the acceptable 1.2
version of the API methods? Thank you!
Brian
--
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/68b00e23-7167-49f4-8738-a2ec2d8847f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.