Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get all index and types' names from cluster in ElasticSearch

I have my cluster and I want to know all indexes and types' names in it. I use Sense.

like image 916
Smasell Avatar asked Jun 27 '15 09:06

Smasell


People also ask

How do I list all the indexes of a cluster in ES?

You can query localhost:9200/_status and that will give you a list of indices and information about each.

How do I get all Elasticsearch index data?

Elasticsearch will get significant slower if you just add some big number as size, one method to use to get all documents is using scan and scroll ids. The results from this would contain a _scroll_id which you have to query to get the next 100 chunk. This answer needs more updates. search_type=scan is now deprecated.

How do I view contents in Elasticsearch?

You can view any existing index by using the below CURL. Please replace the index-name with your actual name before running and it will run as is. Show activity on this post. This is to create and view the content, not to view the index.


1 Answers

curl -XGET 'http://localhost:9200/_cat/indices?v' 

will give you all the indexes.

curl -XGET 'http://localhost:9200/_mapping?pretty=true' 

will give you the document types in these indexes, together with their mappings.

like image 176
yvespeirsman Avatar answered Sep 21 '22 15:09

yvespeirsman