Skip to content

Commit 3318c91

Browse files
committed
[DOCS] Reformat get mapping API. Reformat and reuse multi-index params. (#45699)
1 parent 5faa012 commit 3318c91

File tree

3 files changed

+89
-31
lines changed

3 files changed

+89
-31
lines changed

docs/reference/api-conventions.asciidoc

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,33 +21,11 @@ ability to "exclude" (`-`), for example: `test*,-test3`.
2121

2222
All multi index APIs support the following url query string parameters:
2323

24-
[horizontal]
25-
`ignore_unavailable`::
26-
27-
Controls whether to ignore if any specified indices are unavailable,
28-
including indices that don't exist or closed indices. Either `true` or `false`
29-
can be specified.
30-
31-
`allow_no_indices`::
24+
include::{docdir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailable]
3225

33-
Controls whether to fail if a wildcard indices expression results in no
34-
concrete indices. Either `true` or `false` can be specified. For example if
35-
the wildcard expression `foo*` is specified and no indices are available that
36-
start with `foo`, then depending on this setting the request will fail. This
37-
setting is also applicable when `_all`, `*`, or no index has been specified. This
38-
settings also applies for aliases, in case an alias points to a closed index.
26+
include::{docdir}/rest-api/common-parms.asciidoc[tag=allow-no-indices]
3927

40-
`expand_wildcards`::
41-
42-
Controls what kind of concrete indices that wildcard indices expressions can expand
43-
to. If `open` is specified then the wildcard expression is expanded to only
44-
open indices. If `closed` is specified then the wildcard expression is
45-
expanded only to closed indices. Also both values (`open,closed`) can be
46-
specified to expand to all indices.
47-
+
48-
If `none` is specified then wildcard expansion will be disabled. If `all`
49-
is specified, wildcard expressions will expand to all indices (this is equivalent
50-
to specifying `open,closed`).
28+
include::{docdir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
5129

5230
The defaults settings for the above parameters depend on the API being used.
5331

docs/reference/indices/get-mapping.asciidoc

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
[[indices-get-mapping]]
2-
=== Get Mapping
2+
=== Get mapping API
3+
++++
4+
<titleabbrev>Get mapping</titleabbrev>
5+
++++
36

4-
The get mapping API allows to retrieve mapping definitions for an index or
5-
index/type.
7+
Retrieves <<mapping,mapping definitions>> for indices in a cluster.
68

79
[source,js]
810
--------------------------------------------------
@@ -13,10 +15,46 @@ GET /twitter/_mapping
1315

1416
NOTE: Before 7.0.0, the 'mappings' definition used to include a type name. Although mappings
1517
in responses no longer contain a type name by default, you can still request the old format
16-
through the parameter include_type_name. For more details, please see <<removal-of-types>>.
18+
through the parameter `include_type_name`. For more details, please see <<removal-of-types>>.
1719

18-
[float]
19-
==== Multiple Indices
20+
21+
[[get-mapping-api-request]]
22+
==== {api-request-title}
23+
24+
`GET /_mapping`
25+
26+
`GET /{index}/_mapping`
27+
28+
29+
[[get-mapping-api-path-params]]
30+
==== {api-path-parms-title}
31+
32+
include::{docdir}/rest-api/common-parms.asciidoc[tag=index]
33+
34+
35+
[[get-mapping-api-query-params]]
36+
==== {api-query-parms-title}
37+
38+
include::{docdir}/rest-api/common-parms.asciidoc[tag=allow-no-indices]
39+
40+
include::{docdir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
41+
+
42+
Defaults to `open`.
43+
44+
include::{docdir}/rest-api/common-parms.asciidoc[tag=include-type-name]
45+
46+
include::{docdir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailable]
47+
48+
include::{docdir}/rest-api/common-parms.asciidoc[tag=local]
49+
50+
include::{docdir}/rest-api/common-parms.asciidoc[tag=master-timeout]
51+
52+
53+
[[get-mapping-api-example]]
54+
==== {api-examples-title}
55+
56+
[[get-mapping-api-multi-ex]]
57+
===== Multiple indices
2058

2159
The get mapping API can be used to get more than one index with a
2260
single call. General usage of the API follows the following syntax:

docs/reference/rest-api/common-parms.asciidoc

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,38 @@
11

2+
tag::allow-no-indices[]
3+
`allow_no_indices`::
4+
(Optional, boolean) If `true`, the request returns an error if a wildcard
5+
expression or `_all` value retrieves only missing or closed indices. This
6+
parameter also applies to <<indices-aliases,index aliases>> that point to a
7+
missing or closed index.
8+
end::allow-no-indices[]
9+
210
tag::bytes[]
311
`bytes`::
412
(Optional, <<byte-units,byte size units>>) Unit used to display byte values.
513
end::bytes[]
614

15+
tag::expand-wildcards[]
16+
`expand_wildcards`::
17+
+
18+
--
19+
(Optional, string) Controls what kind of indices that wildcard
20+
expressions can expand to. Valid values are:
21+
22+
`all`::
23+
Expand to open and closed indices.
24+
25+
`open`::
26+
Expand only to open indices.
27+
28+
`closed`::
29+
Expand only to closed indices.
30+
31+
`none`::
32+
Wildcard expressions are not accepted.
33+
--
34+
end::expand-wildcards[]
35+
736
tag::cat-h[]
837
`h`::
938
(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].
2857
Valid values include JSON, YAML, etc.
2958
end::http-format[]
3059

60+
tag::include-type-name[]
61+
`include_type_name`::
62+
deprecated:[7.0.0, Mapping types have been deprecated. See <<removal-of-types>>.]
63+
(Optional, boolean) If `true`, a mapping type is expected in the body of
64+
mappings. Defaults to `false`.
65+
end::include-type-name[]
66+
67+
tag::index-ignore-unavailable[]
68+
`ignore_unavailable`::
69+
(Optional, boolean) If `true`, missing or closed indices are not included in the
70+
response. Defaults to `false`.
71+
end::index-ignore-unavailable[]
72+
3173
tag::include-unloaded-segments[]
3274
`include_unloaded_segments`::
3375
(Optional, boolean) If `true`, the response includes information from segments

0 commit comments

Comments
 (0)