From 6d2df0dc183a3e7dc1b9aeb856fd6ab9b94d2b54 Mon Sep 17 00:00:00 2001 From: Jim Ferenczi Date: Wed, 29 Jun 2016 15:25:51 +0200 Subject: [PATCH] Fix docs example for the _id field, the field is not accessible in scripts --- docs/reference/mapping/fields/id-field.asciidoc | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/docs/reference/mapping/fields/id-field.asciidoc b/docs/reference/mapping/fields/id-field.asciidoc index f99f1ec9723..c640b561571 100644 --- a/docs/reference/mapping/fields/id-field.asciidoc +++ b/docs/reference/mapping/fields/id-field.asciidoc @@ -7,8 +7,8 @@ indexed as its value can be derived automatically from the <> field. The value of the `_id` field is accessible in certain queries (`term`, -`terms`, `match`, `query_string`, `simple_query_string`) and scripts, but -_not_ in aggregations or when sorting, where the <> +`terms`, `match`, `query_string`, `simple_query_string`), but +_not_ in aggregations, scripts or when sorting, where the <> field should be used instead: [source,js] @@ -30,18 +30,9 @@ GET my_index/_search "terms": { "_id": [ "1", "2" ] <1> } - }, - "script_fields": { - "UID": { - "script": { - "lang": "painless", - "inline": "doc['_id']" <2> - } - } } } -------------------------- // CONSOLE <1> Querying on the `_id` field (also see the <>) -<2> Accessing the `_id` field in scripts