mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-25 15:47:23 -04:00
This PR introduces the lookup runtime fields which are used to retrieve data from the related indices. The below search request enriches its search hits with the location of each IP address from the `ip_location` index. ``` POST logs/_search { "runtime_mappings": { "location": { "type": "lookup", "lookup_index": "ip_location", "query_type": "term", "query_input_field": "ip", "query_target_field": "_id", "fetch_fields": [ "country", "city" ] } }, "fields": [ "timestamp", "message", "location" ] } ``` Response: ``` { "hits": { "hits": [ { "_index": "logs", "_id": "1", "fields": { "location": [ { "city": [ "Montreal" ], "country": [ "Canada" ] } ], "message": [ "the first message" ] } } ] } } ``` |
||
---|---|---|
.. | ||
dynamic | ||
fields | ||
params | ||
types | ||
dynamic-mapping.asciidoc | ||
explicit-mapping.asciidoc | ||
fields.asciidoc | ||
mapping-settings-limit.asciidoc | ||
params.asciidoc | ||
removal_of_types.asciidoc | ||
runtime.asciidoc | ||
types.asciidoc |