Skip to content

Instantly share code, notes, and snippets.

@osmianski
Last active March 14, 2022 06:37
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save osmianski/225bc158c910be534d7ddcfc582685c6 to your computer and use it in GitHub Desktop.
Useful queries for checking ElasticSearch indexes
# list all indexes
curl 'localhost:9200/_cat/indices?v'
# dump the index definition into a file
curl 'localhost:9200/{index}/_mapping?pretty' > ~/es_schema.json
# dump the index into a file
curl -XPOST 'localhost:9200/{index}/_search?pretty' \
-H "Content-Type: application/json" \
-d '{"size": 10000, "query": { "match_all": {} }}' > ~/es_data.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment