[DOCS] Reformat get mapping API. Reformat and reuse multi-index params. (#45699)
This commit is contained in:
parent
5faa012fd6
commit
3318c91fea
|
@ -21,33 +21,11 @@ ability to "exclude" (`-`), for example: `test*,-test3`.
|
||||||
|
|
||||||
All multi index APIs support the following url query string parameters:
|
All multi index APIs support the following url query string parameters:
|
||||||
|
|
||||||
[horizontal]
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailable]
|
||||||
`ignore_unavailable`::
|
|
||||||
|
|
||||||
Controls whether to ignore if any specified indices are unavailable,
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=allow-no-indices]
|
||||||
including indices that don't exist or closed indices. Either `true` or `false`
|
|
||||||
can be specified.
|
|
||||||
|
|
||||||
`allow_no_indices`::
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
|
||||||
|
|
||||||
Controls whether to fail if a wildcard indices expression results in no
|
|
||||||
concrete indices. Either `true` or `false` can be specified. For example if
|
|
||||||
the wildcard expression `foo*` is specified and no indices are available that
|
|
||||||
start with `foo`, then depending on this setting the request will fail. This
|
|
||||||
setting is also applicable when `_all`, `*`, or no index has been specified. This
|
|
||||||
settings also applies for aliases, in case an alias points to a closed index.
|
|
||||||
|
|
||||||
`expand_wildcards`::
|
|
||||||
|
|
||||||
Controls what kind of concrete indices that wildcard indices expressions can expand
|
|
||||||
to. If `open` is specified then the wildcard expression is expanded to only
|
|
||||||
open indices. If `closed` is specified then the wildcard expression is
|
|
||||||
expanded only to closed indices. Also both values (`open,closed`) can be
|
|
||||||
specified to expand to all indices.
|
|
||||||
+
|
|
||||||
If `none` is specified then wildcard expansion will be disabled. If `all`
|
|
||||||
is specified, wildcard expressions will expand to all indices (this is equivalent
|
|
||||||
to specifying `open,closed`).
|
|
||||||
|
|
||||||
The defaults settings for the above parameters depend on the API being used.
|
The defaults settings for the above parameters depend on the API being used.
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
[[indices-get-mapping]]
|
[[indices-get-mapping]]
|
||||||
=== Get Mapping
|
=== Get mapping API
|
||||||
|
++++
|
||||||
|
<titleabbrev>Get mapping</titleabbrev>
|
||||||
|
++++
|
||||||
|
|
||||||
The get mapping API allows to retrieve mapping definitions for an index or
|
Retrieves <<mapping,mapping definitions>> for indices in a cluster.
|
||||||
index/type.
|
|
||||||
|
|
||||||
[source,js]
|
[source,js]
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
|
@ -13,10 +15,46 @@ GET /twitter/_mapping
|
||||||
|
|
||||||
NOTE: Before 7.0.0, the 'mappings' definition used to include a type name. Although mappings
|
NOTE: Before 7.0.0, the 'mappings' definition used to include a type name. Although mappings
|
||||||
in responses no longer contain a type name by default, you can still request the old format
|
in responses no longer contain a type name by default, you can still request the old format
|
||||||
through the parameter include_type_name. For more details, please see <<removal-of-types>>.
|
through the parameter `include_type_name`. For more details, please see <<removal-of-types>>.
|
||||||
|
|
||||||
[float]
|
|
||||||
==== Multiple Indices
|
[[get-mapping-api-request]]
|
||||||
|
==== {api-request-title}
|
||||||
|
|
||||||
|
`GET /_mapping`
|
||||||
|
|
||||||
|
`GET /{index}/_mapping`
|
||||||
|
|
||||||
|
|
||||||
|
[[get-mapping-api-path-params]]
|
||||||
|
==== {api-path-parms-title}
|
||||||
|
|
||||||
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=index]
|
||||||
|
|
||||||
|
|
||||||
|
[[get-mapping-api-query-params]]
|
||||||
|
==== {api-query-parms-title}
|
||||||
|
|
||||||
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=allow-no-indices]
|
||||||
|
|
||||||
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
|
||||||
|
+
|
||||||
|
Defaults to `open`.
|
||||||
|
|
||||||
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=include-type-name]
|
||||||
|
|
||||||
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailable]
|
||||||
|
|
||||||
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=local]
|
||||||
|
|
||||||
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=master-timeout]
|
||||||
|
|
||||||
|
|
||||||
|
[[get-mapping-api-example]]
|
||||||
|
==== {api-examples-title}
|
||||||
|
|
||||||
|
[[get-mapping-api-multi-ex]]
|
||||||
|
===== Multiple indices
|
||||||
|
|
||||||
The get mapping API can be used to get more than one index with a
|
The get mapping API can be used to get more than one index with a
|
||||||
single call. General usage of the API follows the following syntax:
|
single call. General usage of the API follows the following syntax:
|
||||||
|
|
|
@ -1,9 +1,38 @@
|
||||||
|
|
||||||
|
tag::allow-no-indices[]
|
||||||
|
`allow_no_indices`::
|
||||||
|
(Optional, boolean) If `true`, the request returns an error if a wildcard
|
||||||
|
expression or `_all` value retrieves only missing or closed indices. This
|
||||||
|
parameter also applies to <<indices-aliases,index aliases>> that point to a
|
||||||
|
missing or closed index.
|
||||||
|
end::allow-no-indices[]
|
||||||
|
|
||||||
tag::bytes[]
|
tag::bytes[]
|
||||||
`bytes`::
|
`bytes`::
|
||||||
(Optional, <<byte-units,byte size units>>) Unit used to display byte values.
|
(Optional, <<byte-units,byte size units>>) Unit used to display byte values.
|
||||||
end::bytes[]
|
end::bytes[]
|
||||||
|
|
||||||
|
tag::expand-wildcards[]
|
||||||
|
`expand_wildcards`::
|
||||||
|
+
|
||||||
|
--
|
||||||
|
(Optional, string) Controls what kind of indices that wildcard
|
||||||
|
expressions can expand to. Valid values are:
|
||||||
|
|
||||||
|
`all`::
|
||||||
|
Expand to open and closed indices.
|
||||||
|
|
||||||
|
`open`::
|
||||||
|
Expand only to open indices.
|
||||||
|
|
||||||
|
`closed`::
|
||||||
|
Expand only to closed indices.
|
||||||
|
|
||||||
|
`none`::
|
||||||
|
Wildcard expressions are not accepted.
|
||||||
|
--
|
||||||
|
end::expand-wildcards[]
|
||||||
|
|
||||||
tag::cat-h[]
|
tag::cat-h[]
|
||||||
`h`::
|
`h`::
|
||||||
(Optional, string) Comma-separated list of column names to display.
|
(Optional, string) Comma-separated list of column names to display.
|
||||||
|
@ -28,6 +57,19 @@ https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html[HTTP accept header].
|
||||||
Valid values include JSON, YAML, etc.
|
Valid values include JSON, YAML, etc.
|
||||||
end::http-format[]
|
end::http-format[]
|
||||||
|
|
||||||
|
tag::include-type-name[]
|
||||||
|
`include_type_name`::
|
||||||
|
deprecated:[7.0.0, Mapping types have been deprecated. See <<removal-of-types>>.]
|
||||||
|
(Optional, boolean) If `true`, a mapping type is expected in the body of
|
||||||
|
mappings. Defaults to `false`.
|
||||||
|
end::include-type-name[]
|
||||||
|
|
||||||
|
tag::index-ignore-unavailable[]
|
||||||
|
`ignore_unavailable`::
|
||||||
|
(Optional, boolean) If `true`, missing or closed indices are not included in the
|
||||||
|
response. Defaults to `false`.
|
||||||
|
end::index-ignore-unavailable[]
|
||||||
|
|
||||||
tag::include-unloaded-segments[]
|
tag::include-unloaded-segments[]
|
||||||
`include_unloaded_segments`::
|
`include_unloaded_segments`::
|
||||||
(Optional, boolean) If `true`, the response includes information from segments
|
(Optional, boolean) If `true`, the response includes information from segments
|
||||||
|
|
Loading…
Reference in New Issue