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
|
|
|
|
<3> The types to be returned
|
|
|
|
<4> The fields to be returned
|
|
|
|
|
|
|
|
==== 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
|
|
|
--------------------------------------------------
|
|
|
|
<1> The `local` flag (defaults to `false`) controls whether the aliases need
|
|
|
|
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
|
|
|
|
<2> Retrieving the mappings for a particular index and type
|
|
|
|
<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
|
|
|
|
|