Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS] Reformat get mapping API. Reformat and reuse multi-index params. #45699

Merged
merged 4 commits into from
Aug 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 3 additions & 25 deletions docs/reference/api-conventions.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,11 @@ ability to "exclude" (`-`), for example: `test*,-test3`.

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

[horizontal]
`ignore_unavailable`::

Controls whether to ignore if any specified indices are unavailable,
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=index-ignore-unavailable]

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.
include::{docdir}/rest-api/common-parms.asciidoc[tag=allow-no-indices]

`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`).
include::{docdir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]

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

Expand Down
50 changes: 44 additions & 6 deletions docs/reference/indices/get-mapping.asciidoc
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[[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
index/type.
Retrieves <<mapping,mapping definitions>> for indices in a cluster.

[source,js]
--------------------------------------------------
Expand All @@ -13,10 +15,46 @@ GET /twitter/_mapping

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
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
single call. General usage of the API follows the following syntax:
Expand Down
42 changes: 42 additions & 0 deletions docs/reference/rest-api/common-parms.asciidoc
Original file line number Diff line number Diff line change
@@ -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[]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jrodewig It seems this behaves opposite of the description here. afaict allow_no_indices = true will allow empty indices and thus not return an error. allow_no_indices = false will not allow empty and will return an error if empty indicies are encountered.

cc @weltenwort

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this @sqren. I've opened #46450 to correct.


tag::bytes[]
`bytes`::
(Optional, <<byte-units,byte size units>>) Unit used to display byte values.
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[]
`h`::
(Optional, string) Comma-separated list of column names to display.
Expand All @@ -28,6 +57,19 @@ https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html[HTTP accept header].
Valid values include JSON, YAML, etc.
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[]
`include_unloaded_segments`::
(Optional, boolean) If `true`, the response includes information from segments
Expand Down