Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS] Rewords _field_names documentation #31029

Merged
merged 2 commits into from
Jun 4, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 9 additions & 35 deletions docs/reference/mapping/fields/field-names-field.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,18 @@
The `_field_names` field indexes the names of every field in a document that
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is no longer correct. Perhaps you can change it to "used to index" and explain that it is no longer required if the field has norms or doc values enabled.

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_names` field is accessible in queries:

[source,js]
--------------------------
# Example documents
PUT my_index/_doc/1
{
"title": "This is a document"
}

PUT my_index/_doc/2?refresh=true
{
"title": "This is another document",
"body": "This document has a body"
}

GET my_index/_search
{
"query": {
"terms": {
"_field_names": [ "title" ] <1>
}
}
}

--------------------------
// CONSOLE

<1> Querying on the `_field_names` field (also see the <<query-dsl-exists-query,`exists`>> query)

either have or don't have any non-+null+ value for fields that have
`doc_values` and `norms` disabled. Only fields which have `doc_values`
and `norms` disabled and are present in the document will have values
indexed into the `field_names` field.

==== Disabling `_field_names`

Because `_field_names` introduce some index-time overhead, you might want to
disable this field if you want to optimize for indexing speed and do not need
`exists` queries.
Disabling `_field_names` is often not necessary because it no longer
carries the index overhead it once did. If you have a lot of fields
which have `doc_values` and `norms` disabled and you do not need to
execute `exists` queries using those fields you might want to disable
`_field_names` be adding the following to the mappings:

[source,js]
--------------------------------------------------
Expand Down