Limiting the number of indices that are searched reduces the load on the cluster and improves execution performance.express
form:app
<static_name{date_math_expr{date_format|time_zone}}>
例如:
GET /<logstash-{now/d-2d}>,<logstash-{now/d-1d}>,<logstash-{now/d}>/_search
實際調用特殊字符要encode:GET /%3Clogstash-%7Bnow%2Fd-2d%7D%3E%2C%3Clogstash-%7Bnow%2Fd-1d%7D%3E%2C%3Clogstash-%7Bnow%2Fd%7D%3E/_search
報文體省略elasticsearch
?pretty=true
to any request made, the JSON returned will be pretty formatted (use it for debugging only!).?human=true
to the query string.GET /_cluster/state?filter_path=metadata.indices.*.stat* Responds: { "metadata" : { "indices" : { "twitter": {"state": "open"} } } }
the **
wildcard can be used to include fields without knowing the exact path of the field. url
exclude one or more fields by prefixing the filter with the char -
:debug
GET /_count?filter_path=-_shards
both inclusive and exclusive filters can be combined in the same expression.rest
raw value of a field, like the _source field.code
# 只獲取hits.hits._source字段且_source中title字段,按_source中rating字段降序排序 GET /_search?filter_path=hits.hits._source&_source=title&sort=rating:desc
error_trace=true
elasticsearch.yml
file:orm
rest.action.multi.allow_explicit_index: false
Elasticsearch will reject requests that have an explicit index specified in the request body.排序