Skip to content

Commit 8de0a8f

Browse files
committed
Add docs for index component selector api convention
1 parent 13bce60 commit 8de0a8f

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

docs/reference/elasticsearch/rest-apis/api-conventions.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,40 @@ GET /_nodes/ra*:2
421421
GET /_nodes/ra*:2*
422422
```
423423

424+
### Index Component Selectors [api-component-selectors]
425+
426+
Some APIs that accept a `<data-stream>`, `<index>`, or `<target>` request path parameter also support *selector syntax*.
427+
428+
Some indices and data streams are made of multiple components besides their default data. These other components store additional data which can be queried separately like a regular index. Some APIs may operate on subsets of these index components which can be specified by using a selector suffix.
429+
430+
There are currently two selector suffixes supported by {{es}} APIs:
431+
432+
`::data`
433+
: (Indices, data streams) This selector references the default component present on all indices and data streams which holds the regular data contained therein.
434+
435+
`::failures`
436+
: (Data streams only) This component references data stored in a data stream's [failure store](docs-content://manage-data/data-store/data-streams/failure-store.md). This component is only present on data streams.
437+
438+
As an example, [search]({{es-apis}}group/endpoint-search), [field capabilities]({{es-apis}}operation/operation-field-caps), and [index stats]({{es-apis}}operation/operation-indices-stats) APIs can all report results from a different component rather than from the default data.
439+
440+
Selectors are applied to an index pattern at the end and can be combined with other index pattern syntax like [date math](#api-date-math-index-names) and wildcards.
441+
442+
```console
443+
# Search for regular data on a data stream
444+
GET my-data-stream/_search
445+
# Search for failure data on a data stream
446+
GET my-data-stream::failures/_search
447+
448+
# Syntax can be combined with other index pattern syntax (wildcards, multi-target, date math, cross cluster search, etc)
449+
GET logs-*::failures/_search
450+
GET logs-*::data,logs-*::failures/_count
451+
GET remote-cluster:logs-*-*::failures/_search
452+
GET *::data,*::failures,-logs-rdbms-*::failures/_stats
453+
GET <logs-{now/d}>::failures/_search
454+
```
455+
456+
457+
424458
## Parameters [api-conventions-parameters]
425459

426460
Rest parameters (when using HTTP, map to HTTP URL parameters) follow the convention of using underscore casing.

0 commit comments

Comments
 (0)