Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elastic4s: How do I get all index names from ElasticSearch?

Tags:

elastic4s

I am using Elastic4s. I need to find all index names from an instance of ElasticSearch. What API shall I use?

like image 731
Ningjun Avatar asked Oct 19 '25 03:10

Ningjun


2 Answers

For Elastic4s version: 6.5.0. You can get all the indices using catIndices api provided by Elastic4s.

Here's an example:

val resp = client.execute {
  catIndices
}

You can refer the official doc for more info.

like image 130
Tarang Bhalodia Avatar answered Oct 22 '25 02:10

Tarang Bhalodia


In elastic 1.6.5 you can do,

val resp = client.execute {
  clusterState
}
like image 28
sksamuel Avatar answered Oct 22 '25 02:10

sksamuel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!