Skip to content

Commit 707067e

Browse files
committed
Add documentation about disabling _field_names. (#26813)
This field has significant index-time overhead. Closes #26779
1 parent 25cf81b commit 707067e

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

docs/reference/how-to/indexing-speed.asciidoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,13 @@ The default is `10%` which is often plenty: for example, if you give the JVM
114114
10GB of memory, it will give 1GB to the index buffer, which is enough to host
115115
two shards that are heavily indexing.
116116

117+
[float]
118+
=== Disable `_field_names`
119+
120+
The <<mapping-field-names-field,`_field_names` field>> introduces some
121+
index-time overhead, so you might want to disable it if you never need to
122+
run `exists` queries.
123+
117124
[float]
118125
=== Additional optimizations
119126

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,25 @@ GET my_index/_search
3535
// CONSOLE
3636

3737
<1> Querying on the `_field_names` field (also see the <<query-dsl-exists-query,`exists`>> query)
38+
39+
40+
==== Disabling `_field_names`
41+
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.
45+
46+
[source,js]
47+
--------------------------------------------------
48+
PUT tweets
49+
{
50+
"mappings": {
51+
"tweet": {
52+
"_field_names": {
53+
"enabled": false
54+
}
55+
}
56+
}
57+
}
58+
--------------------------------------------------
59+
// CONSOLE

0 commit comments

Comments
 (0)