elasticsearch/docs/reference/mapping
Nhat Nguyen 31d703f24c
Introduce lookup runtime fields (#82385)
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" ]
        }
      }
    ]
  }
}
```
2022-02-22 21:36:19 -05:00
..
dynamic [DOCS] Update dynamic mapping docs to clarify supported match_mapping_type (#83274) 2022-02-01 10:37:27 -05:00
fields [DOCS] Custom routing for data streams 2021-11-10 07:11:50 -06:00
params Add extra section on doc-value-only fields to documentation (#84209) 2022-02-22 11:46:10 +01:00
types [DOCS] Clarify orientation usage for WKT and GeoJSON polygons (#84025) 2022-02-17 10:33:06 -05:00
dynamic-mapping.asciidoc [DOCS] Clean up index template xrefs (#67264) 2021-01-11 12:38:09 -05:00
explicit-mapping.asciidoc [DOCS] Replace put with create or update in API names (#70330) 2021-03-15 14:49:44 -04:00
fields.asciidoc Support fetching _tier field value (#71379) 2021-04-08 11:41:52 -07:00
mapping-settings-limit.asciidoc [DOCS] Relocate index.mapping.dimension_fields.limit setting docs (#80964) 2021-11-23 14:51:28 -05:00
params.asciidoc Clarify field data cache behavior in docs (#64375) 2020-11-20 13:53:23 -08:00
removal_of_types.asciidoc [DOCS] Fix double spaces (#71082) 2021-03-31 09:57:47 -04:00
runtime.asciidoc Introduce lookup runtime fields (#82385) 2022-02-22 21:36:19 -05:00
types.asciidoc [DOCS] Change field alias anchor (#73043) 2021-05-13 09:32:36 -04:00