I have a use case where I have to query on the latest es index from java . Es indexes are of the pattern indexName-date . Is there a way I can do that ??
Asked
Active
Viewed 65 times
1 Answers
0
not directly to Elasticsearch, no, as there's nothing native to do that
you'd need to grab the list of indices and then sort by date and get the latest yourself

warkolm
- 1,933
- 1
- 4
- 12
-
1Yeah I see that the only way forward . Thanks for confirming. – Akshay Sharma Sep 30 '21 at 06:58
-
Anyone reaching here can use https://stackoverflow.com/questions/23223714/how-to-get-a-list-of-indices-from-elasticsearch-using-jest following link to get indexes matching a regex pattern and then sort them to get the latest index . – Akshay Sharma Oct 03 '21 at 03:35