Command | Description |
---|---|
Versions and Cluster/Node-Names
GET /
|
The first thing you need to do. Check what kind of Elasticsearch is running your cluster! |
Cluster Health
GET /_cat/health?v
|
Is your cluster running smoothly? Are all nodes and (replica-)shards running? Check if status==green! ES-doc |
Cluster Statistics & Count
GET /_cluster/stats?human
|
Get detailed statistics all in one: Doc-Count, Shard-Count, Size/Storage, Nodes, Operation System, free Memory, Java-Versions, Plugins ..... ES-doc |
Indices - Status & Size
GET /_cat/indices?v&s=store.size:desc
|
List all indices sorted by size. Shows their status. Particularly if the health status above is yellow you can break down which index isn't green. (Common case for a yellow-status: You have just one node but replicas defined for a specific index). Shows also doc-count and index-size! ES-doc |
Shards - Check status / replication
GET /_cat/shards?v
|
List all shards and shows the status. Useful if your cluster is in health status yellow or red. You can check which shards are running, which are replicated and which index has missing shards. ES-doc |
Aliases Overview
GET /_cat/aliases?v
|
Are there any aliases defined which should be used to access an index? Do the aliases include filters or routing-configuration? ES-doc |
Nodes Overview
GET /_cat/nodes?v
|
If you are running Elasticsearch with more than one instance (server) you can list all your nodes with this command. ES-doc |
Plugins for each Node
GET /_cat/plugins?v
|
Check if there are any plugins installed. If so, do they run on all nodes? ES-doc |
Index Templates
GET /_cat/templates?v
GET _template/<template-name>
|
Are there any Index-Templates defined? Second command shows the specific settings and mapping-configs of a template (or all with *) that gets applied at index creation time. ES-doc |
Settings
GET /<index-pattern>/_settings/
|
Shows the settings of a specific index (including analysis-stuff, names, shard-configuration and more....). ES-doc |
Types & Mappings
GET /<index-pattern>/_mapping/<?type>
|
Shows the mapping-configuration for all types of a specific index. Optional you can specify a type for restricting mapping-information. (Tip: If you just wanna view types and if you use Kibana use GET /<index>/_mapping/, click in the result window, press Ctrl-Alt-0 and expand....) ES-doc |
Doc-Count per Type
GET /<index-pattern>/_search
|
Counts the available documents for each document-type. (Note: Types without any docs are not found and therefore not shown in the result.) ES-doc |
Search some documents
GET /<index-pattern>/<?type>/_search?size=3&_source=<field-name>,<field-name>&q=<field-name>:<searchterm>
|
Show some (random) documents. Good to see some example docs or search for a specific one. Use "size" and "_source" to restrict output. Use parameter "q" to search for something specific. (<?type>/-path and any parameter can be omitted!) ES-doc |
Get document
GET /<index-name>/_all/<doc-id>
|
If you need a concrete document and you know the index-name and the doc-id ("_id") this is the fasted way to go. ES-doc |
Analyzing indexed text
GET /<index_name>/_analyze
|
Check how text-analyzing works for your index. First check for analyzer-names with the _settings command above. Use "standard" as analyzer-name if you would like to test with the Elasticsearch standard-analyzer. Remove the "analyzer"-parameter to check the "default"-analyzer behavior. <your text> is analyzed and you see the resulting tokens (used for indexing and search-queries). ES-doc |
Validate & explain query
GET <index_name>/_all/_validate/query?rewrite=true&explain=true
|
Get insides into your query. Using the "rewrite" parameter the actual Lucene query that will be executed is shown. The "explain" parameter gives you more detailed information about why a query failed. ES-doc |