Updates the existing API conventions docs to make them aware of data streams. Co-authored-by: debadair <debadair@elastic.co>
This commit is contained in:
parent
046d9eeb41
commit
3aa08fbcde
|
@ -13,14 +13,21 @@ API, unless otherwise specified.
|
|||
* <<url-access-control>>
|
||||
|
||||
[[multi-index]]
|
||||
=== Multiple indices
|
||||
=== Multi-target syntax
|
||||
|
||||
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 `te*t` or `*test*`, and the
|
||||
ability to "exclude" (`-`), for example: `test*,-test3`.
|
||||
Most APIs that accept a `<data-stream>`, `<index>`, or `<target>` request path
|
||||
parameter also support _multi-target syntax_.
|
||||
|
||||
All multi index APIs support the following url query string parameters:
|
||||
In multi-target syntax, you can use a comma-separated list to execute a request across multiple resources, such as
|
||||
data streams, indices, or index aliases: `test1,test2,test3`. You can also use
|
||||
https://en.wikipedia.org/wiki/Glob_(programming)[glob-like] wildcard (`*`)
|
||||
expressions to target any
|
||||
resources that match the pattern: `test*` or `*test` or `te*t` or `*test*.
|
||||
|
||||
You can exclude targets using the `-` character: `test*,-test3`.
|
||||
|
||||
Multi-target APIs that can target indices support the following query
|
||||
string parameters:
|
||||
|
||||
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailable]
|
||||
|
||||
|
@ -30,12 +37,14 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
|
|||
|
||||
The defaults settings for the above parameters depend on the API being used.
|
||||
|
||||
Some multi index APIs also support the following url query string parameter:
|
||||
Some multi-target APIs that can target indices also support the following query
|
||||
string parameter:
|
||||
|
||||
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=ignore_throttled]
|
||||
|
||||
NOTE: Single index APIs such as the <<docs>> and the
|
||||
<<indices-aliases,single-index `alias` APIs>> do not support multiple indices.
|
||||
NOTE: Single index APIs, such as the <<docs>> and
|
||||
<<indices-aliases,single-index `alias` APIs>>, do not support multi-target
|
||||
syntax.
|
||||
|
||||
[[date-math-index-names]]
|
||||
=== Date math support in index names
|
||||
|
@ -660,15 +669,14 @@ string parameter.
|
|||
=== URL-based access control
|
||||
|
||||
Many users use a proxy with URL-based access control to secure access to
|
||||
Elasticsearch indices. For <<search-multi-search,multi-search>>,
|
||||
{es} data streams and indices. For <<search-multi-search,multi-search>>,
|
||||
<<docs-multi-get,multi-get>>, and <<docs-bulk,bulk>> requests, the user has
|
||||
the choice of specifying an index in the URL and on each individual request
|
||||
the choice of specifying a data stream or index in the URL and on each individual request
|
||||
within the request body. This can make URL-based access control challenging.
|
||||
|
||||
To prevent the user from overriding the index which has been specified in the
|
||||
URL, add this setting to the `elasticsearch.yml` file:
|
||||
To prevent the user from overriding the data stream or index specified in the
|
||||
URL, set `rest.action.multi.allow_explicit_index` to `false` in `elasticsearch.yml`.
|
||||
|
||||
rest.action.multi.allow_explicit_index: false
|
||||
|
||||
The default value is `true`, but when set to `false`, Elasticsearch will
|
||||
reject requests that have an explicit index specified in the request body.
|
||||
This causes {es} to
|
||||
reject requests that explicitly specfiy a data stream or index in the request body.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[[search]]
|
||||
== Search APIs
|
||||
|
||||
Most search APIs are <<search-multi-index,multi-index>>, with the
|
||||
Most search APIs support <<search-multi-index,multi-target syntax>>, with the
|
||||
exception of the <<search-explain>> endpoints.
|
||||
|
||||
[float]
|
||||
|
|
|
@ -33,7 +33,7 @@ By default, all indices in the snapshot are restored, and the cluster state is
|
|||
*not* restored. It's possible to select indices that should be restored as well
|
||||
as to allow the global cluster state from being restored by using `indices` and
|
||||
`include_global_state` options in the restore request body. The list of indices
|
||||
supports <<multi-index,multi index syntax>>. The `rename_pattern`
|
||||
supports <<multi-index,multi-target syntax>>. The `rename_pattern`
|
||||
and `rename_replacement` options can be also used to rename indices on restore
|
||||
using regular expression that supports referencing the original text as
|
||||
explained
|
||||
|
|
|
@ -52,7 +52,7 @@ PUT /_snapshot/my_backup/snapshot_2?wait_for_completion=true
|
|||
// TEST[skip:cannot complete subsequent snapshot]
|
||||
|
||||
The list of indices that should be included into the snapshot can be specified using the `indices` parameter that
|
||||
supports <<multi-index,multi index syntax>>, although the options which control the behavior of multi index syntax
|
||||
supports <<multi-index,multi-target syntax>>, although the options which control the behavior of multi index syntax
|
||||
must be supplied in the body of the request, rather than as request parameters. The snapshot request also supports the
|
||||
`ignore_unavailable` option. Setting it to `true` will cause indices that do not exist to be ignored during snapshot
|
||||
creation. By default, when `ignore_unavailable` option is not set and an index is missing the snapshot request will fail.
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
[float]
|
||||
==== {es} multi-index
|
||||
|
||||
The {es} notation for enumerating, including or excluding <<multi-index,multi index syntax>>
|
||||
The {es} notation for enumerating, including or excluding <<multi-index,multi-target syntax>>
|
||||
is supported _as long_ as it is quoted or escaped as a table identifier.
|
||||
|
||||
For example:
|
||||
|
|
|
@ -27,7 +27,7 @@ patterns.
|
|||
include-tagged::{sql-specs}/docs/docs.csv-spec[showTables]
|
||||
----
|
||||
|
||||
Match multiple indices by using {es} <<multi-index,multi index syntax>>
|
||||
Match multiple indices by using {es} <<multi-index,multi-target syntax>>
|
||||
notation:
|
||||
|
||||
[source, sql]
|
||||
|
|
Loading…
Reference in New Issue