How can the following query's results be sorted by index name?
curl "localhost:9200/_aliases?pretty"
You can query localhost:9200/_status and that will give you a list of indices and information about each.
You can use the search API to search and aggregate data stored in Elasticsearch data streams or indices. The API's query request body parameter accepts queries written in Query DSL. The following request searches my-index-000001 using a match query. This query matches documents with a user.id value of kimchy .
Elasticsearch comes with a good default out of the box. It sorts the results by relevance to the search query term, most relevant first. Elasticsearch measures the relevance score as a floating-point number called _score, and orders results in the descending order of their _score values.
You can ask ES to sort the results via the s
(sort) searchParameter using s=i
or s=index
curl "localhost:9200/_cat/indices?pretty&s=i" curl "localhost:9200/_cat/aliases?pretty&s=index"
To see the column's headers, add "&v" :
curl "localhost:9200/_cat/indices?pretty&v&s=index"`.
You can find some explanations in the cat/indices documentation
GET _cat/aliases?v&s=index:desc&h=alias,index
Will give you:
alias index app-logs-alias app-logs-2017-12-31 backend-logs-read backend-logs-2017-12-31
s = sort, v = various extra detail, h = headings to include,
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