Skip to content

Commit

Permalink
Address code review feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
jtibshirani committed Jun 25, 2018
1 parent da55544 commit f8f613d
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions docs/reference/mapping/types/alias.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

An `alias` mapping defines an alternate name for a field in the index.
The alias can be used in place of the target field in <<search, search>> requests,
and select other APIs like <<search-field-caps, field capabilities>>.
and selected other APIs like <<search-field-caps, field capabilities>>.

[source,js]
--------------------------------
Expand Down Expand Up @@ -43,25 +43,20 @@ GET _search
<1> The path to the target field. Note that this must be the full path, including any parent
objects (e.g. `object1.object2.field`).

All relevant components of the search request accept field aliases. In particular, aliases can be
Almost all components of the search request accept field aliases. In particular, aliases can be
used in queries, aggregations, and sort fields, as well as when requesting `docvalue_fields`,
`stored_fields`, suggestions, and highlights. Scripts also support aliases when accessing
field values.
field values. Please see the section on <<unsupported-apis, unsupported APIs>> for exceptions.

In some parts of the search request and when requesting field capabilities, field wildcard patterns can be
provided. In these cases, the wildcard pattern will match field aliases in addition to concrete fields:

[source,js]
--------------------------------
GET /_search
{
"query" : {
"match_all": {}
},
"docvalue_fields": ["route_*", "transit_mode"]
}
GET trips/_field_caps?fields=route_*,transit_mode
--------------------------------
// CONSOLE
// TEST[continued]

[[alias-targets]]
==== Alias targets
Expand All @@ -88,13 +83,14 @@ source filtering. For example, the following request will return an empty result
--------------------------------
GET /_search
{
"query" : {
"match_all": {}
},
"_source": "route_length_miles"
"query" : {
"match_all": {}
},
"_source": "route_length_miles"
}
--------------------------------
// CONSOLE
// TEST[continued]

Finally, currently only the search and field capabilities APIs will accept and resolve
field aliases. Other APIs that accept field names, such as <<docs-termvectors, term vectors>>,
Expand Down

0 comments on commit f8f613d

Please sign in to comment.