2018-11-27 20:40:49 -05:00
|
|
|
--
|
|
|
|
:api: get-field-mappings
|
|
|
|
:request: GetFieldMappingsRequest
|
|
|
|
:response: GetFieldMappingsResponse
|
|
|
|
--
|
|
|
|
|
|
|
|
[id="{upid}-{api}"]
|
2018-06-23 03:39:17 -04:00
|
|
|
=== Get Field Mappings API
|
|
|
|
|
2018-11-27 20:40:49 -05:00
|
|
|
[id="{upid}-{api}-request"]
|
2018-06-23 03:39:17 -04:00
|
|
|
==== Get Field Mappings Request
|
|
|
|
|
2018-11-27 20:40:49 -05:00
|
|
|
A +{request}+ can have an optional list of indices, optional list of types and the list of fields:
|
2018-06-23 03:39:17 -04:00
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-11-27 20:40:49 -05:00
|
|
|
include-tagged::{doc-tests-file}[{api}-request]
|
2018-06-23 03:39:17 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> An empty request
|
|
|
|
<2> Setting the indices to fetch mapping for
|
2019-01-23 14:24:35 -05:00
|
|
|
<3> The fields to be returned
|
2018-06-23 03:39:17 -04:00
|
|
|
|
|
|
|
==== Optional arguments
|
|
|
|
The following arguments can also optionally be provided:
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-11-27 20:40:49 -05:00
|
|
|
include-tagged::{doc-tests-file}[{api}-request-indicesOptions]
|
2018-06-23 03:39:17 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> Setting `IndicesOptions` controls how unavailable indices are resolved and
|
|
|
|
how wildcard expressions are expanded
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-11-27 20:40:49 -05:00
|
|
|
include-tagged::{doc-tests-file}[{api}-request-local]
|
2018-06-23 03:39:17 -04:00
|
|
|
--------------------------------------------------
|
2020-04-11 23:48:47 -04:00
|
|
|
<1> deprecated:[7.8.0, This parameter is a no-op and field mappings are always retrieved locally]
|
|
|
|
The `local` flag (defaults to `false`) controls whether the aliases need
|
2018-06-23 03:39:17 -04:00
|
|
|
to be looked up in the local cluster state or in the cluster state held by
|
|
|
|
the elected master node
|
|
|
|
|
2018-11-27 20:40:49 -05:00
|
|
|
include::../execution.asciidoc[]
|
2018-06-23 03:39:17 -04:00
|
|
|
|
2018-11-27 20:40:49 -05:00
|
|
|
[id="{upid}-{api}-response"]
|
2018-06-23 03:39:17 -04:00
|
|
|
|
|
|
|
==== Get Field Mappings Response
|
|
|
|
|
2018-11-27 20:40:49 -05:00
|
|
|
The returned +{response}+ allows to retrieve information about the
|
2018-06-23 03:39:17 -04:00
|
|
|
executed operation as follows:
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-11-27 20:40:49 -05:00
|
|
|
include-tagged::{doc-tests-file}[{api}-response]
|
2018-06-23 03:39:17 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> Returning all requested indices fields' mappings
|
2019-01-23 14:24:35 -05:00
|
|
|
<2> Retrieving the mappings for a particular index
|
2018-06-23 03:39:17 -04:00
|
|
|
<3> Getting the mappings metadata for the `message` field
|
|
|
|
<4> Getting the full name of the field
|
|
|
|
<5> Getting the mapping source of the field
|
|
|
|
|