The Elasticsearch REST APIs are exposed using JSON over HTTP.
ES的REST API 是使用基于Http的JSON格式请求的。
The conventions listed in this chapter can be applied throughout the REST API, unless otherwise specified.
这个约定在本章中介绍以下几个点:
- Multiple Indices
- Date math support in index names
- Common options
- URL-based access control
多索引
Most APIs that refer to an index parameter support execution across multiple indices, using simple test1,test2,test3 notation (or _all for all indices). It also supports wildcards, for example: test* or test or tet or test, and the ability to “exclude” (-), for example: test*,-test3.
All multi indices APIs support the following url query string parameters:
ignore_unavailable
allow_no_indices
expand_wildcards
索引名中支持数字和日期
Date math index name resolution enables you to search a range of time-series indices, rather than searching all of your time-series indices and filtering the results or maintaining aliases. Limiting the number of indices that are searched reduces the load on the cluster and improves execution performance. For example, if you are searching for errors in your daily logs, you can use a date math name template to restrict the search to the past two days.
Almost all APIs that have an index parameter support date math in the index parameter value.
A date math index name takes the following form: