Skip to content

Commit 13156dd

Browse files
committed
[DOCS] Rewords _field_names documentation (#31029)
* [DOCS] Rewords _field_names documentation Corrects the language around when we write to `_field_names` and when you might want to disable it given that n recent versions it does not carry the indexing overhead it once did. Relates to #30862 * Update wording following review
1 parent 1eede11 commit 13156dd

File tree

1 file changed

+11
-35
lines changed

1 file changed

+11
-35
lines changed

docs/reference/mapping/fields/field-names-field.asciidoc

Lines changed: 11 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,23 @@
11
[[mapping-field-names-field]]
22
=== `_field_names` field
33

4-
The `_field_names` field indexes the names of every field in a document that
5-
contains any value other than `null`. This field is used by the
4+
The `_field_names` field used to index the names of every field in a document that
5+
contains any value other than `null`. This field was used by the
66
<<query-dsl-exists-query,`exists`>> query to find documents that
77
either have or don't have any non-+null+ value for a particular field.
88

9-
The value of the `_field_names` field is accessible in queries:
10-
11-
[source,js]
12-
--------------------------
13-
# Example documents
14-
PUT my_index/_doc/1
15-
{
16-
"title": "This is a document"
17-
}
18-
19-
PUT my_index/_doc/2?refresh=true
20-
{
21-
"title": "This is another document",
22-
"body": "This document has a body"
23-
}
24-
25-
GET my_index/_search
26-
{
27-
"query": {
28-
"terms": {
29-
"_field_names": [ "title" ] <1>
30-
}
31-
}
32-
}
33-
34-
--------------------------
35-
// CONSOLE
36-
37-
<1> Querying on the `_field_names` field (also see the <<query-dsl-exists-query,`exists`>> query)
38-
9+
Now the `_field_names` field only indexes the names of fields that have
10+
`doc_values` and `norms` disabled. For fields which have either `doc_values`
11+
or `norm` enabled the <<query-dsl-exists-query,`exists`>> query will still
12+
be available but will not use the `_field_names` field.
3913

4014
==== Disabling `_field_names`
4115

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

4622
[source,js]
4723
--------------------------------------------------

0 commit comments

Comments
 (0)