Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to filter or query list of index names in Elasticsearch?

I use the following to list indices

curl localhost:9200/_cat/indices?v 

Is there is any way to filter or query index names, for example like with wildcards?

curl localhost:9200/_cat/indices - d '{
  "query": {
    "prefix": {
      "index": "sam-"
    }
  }
}'

What would be the format in elasticsearch.js?

like image 505
Nithyanand Avatar asked Nov 24 '14 09:11

Nithyanand


People also ask

How do I get a list of indexes in Kibana?

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.

What is the difference between query and filter in Elasticsearch?

Queries are slower it returns a calculated score of how well a document matches the query. Filters are faster because they check only if the document matched or not. Queries produce non-boolean values. Filters produce boolean values.


1 Answers

Simple: curl localhost:9200/_cat/indices/sam-*?v

like image 119
Andrei Stefan Avatar answered Sep 28 '22 03:09

Andrei Stefan