Is there a way to use the Java client to get a list of indexes that are in Elasticsearch? I have been able to find examples of doing this using Marvel/Sense, but I cant seem to find any examples of doing this using the Java client.
To search multiple data streams and indices, add them as comma-separated values in the search API's request path. The following request searches the my-index-000001 and my-index-000002 indices. You can also search multiple data streams and indices using an index pattern.
Open Kibana's main menu and click Stack Management > Index Management. The Index Management page contains an overview of your indices. Badges indicate if an index is a follower index, a rollup index, or frozen. Clicking a badge narrows the list to only indices of that type.
IndexRequest defines the document to add to ElasticSearch, as opposed to UpdateRequest which actually performs the addition into ElasticSearch. Note: UpdateRequest. upsert() expects a separate IndexRequest to be used just if the document does not exist.
Indexes are stored in Elasticsearch as inverted indexes. Indexes are stored in Elasticsearch as inverted indexes. This means that each index contains a list of all the terms that appear in the documents that are stored in that index.
Another way I found to do this:
client.admin()
.indices()
.getIndex(new GetIndexRequest())
.actionGet()
.getIndices()
It's definitely possible but it's unfortunately not documented in the official documentation for the Java client. You can achieve this with:
List<IndexMetaData> indices = client.admin().cluster()
.prepareState().get().getState()
.getMetaData().getIndices();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With