|
@@ -6,7 +6,7 @@ contains any value other than `null`. This field is used by the
|
|
|
<<query-dsl-exists-query,`exists`>> query to find documents that
|
|
|
either have or don't have any non-+null+ value for a particular field.
|
|
|
|
|
|
-The value of the `_field_name` field is accessible in queries and scripts:
|
|
|
+The value of the `_field_name` field is accessible in queries:
|
|
|
|
|
|
[source,js]
|
|
|
--------------------------
|
|
@@ -16,7 +16,7 @@ PUT my_index/my_type/1
|
|
|
"title": "This is a document"
|
|
|
}
|
|
|
|
|
|
-PUT my_index/my_type/1
|
|
|
+PUT my_index/my_type/2?refresh=true
|
|
|
{
|
|
|
"title": "This is another document",
|
|
|
"body": "This document has a body"
|
|
@@ -28,19 +28,10 @@ GET my_index/_search
|
|
|
"terms": {
|
|
|
"_field_names": [ "title" ] <1>
|
|
|
}
|
|
|
- },
|
|
|
- "script_fields": {
|
|
|
- "Field names": {
|
|
|
- "script": {
|
|
|
- "lang": "painless",
|
|
|
- "inline": "doc['_field_names']" <2>
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
--------------------------
|
|
|
// CONSOLE
|
|
|
|
|
|
-<1> Querying on the `_field_names` field (also see the <<query-dsl-exists-query,`exists`>> query)
|
|
|
-<2> Accessing the `_field_names` field in scripts
|
|
|
+<1> Querying on the `_field_names` field (also see the <<query-dsl-exists-query,`exists`>> query)
|