From a709370b93581330f81c9e3b8747c6ed5e48aef1 Mon Sep 17 00:00:00 2001 From: Adrien Grand Date: Fri, 6 Oct 2017 16:49:15 +0200 Subject: [PATCH] Add documentation about disabling `_field_names`. (#26813) This field has significant index-time overhead. Closes #26779 --- docs/reference/how-to/indexing-speed.asciidoc | 7 ++++++ .../mapping/fields/field-names-field.asciidoc | 22 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/docs/reference/how-to/indexing-speed.asciidoc b/docs/reference/how-to/indexing-speed.asciidoc index 668857ed41e4d..db7479f9f7d38 100644 --- a/docs/reference/how-to/indexing-speed.asciidoc +++ b/docs/reference/how-to/indexing-speed.asciidoc @@ -114,6 +114,13 @@ The default is `10%` which is often plenty: for example, if you give the JVM 10GB of memory, it will give 1GB to the index buffer, which is enough to host two shards that are heavily indexing. +[float] +=== Disable `_field_names` + +The <> introduces some +index-time overhead, so you might want to disable it if you never need to +run `exists` queries. + [float] === Additional optimizations diff --git a/docs/reference/mapping/fields/field-names-field.asciidoc b/docs/reference/mapping/fields/field-names-field.asciidoc index 45839ac55d950..9dd1f17cbb3a9 100644 --- a/docs/reference/mapping/fields/field-names-field.asciidoc +++ b/docs/reference/mapping/fields/field-names-field.asciidoc @@ -35,3 +35,25 @@ GET my_index/_search // CONSOLE <1> Querying on the `_field_names` field (also see the <> query) + + +==== 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. + +[source,js] +-------------------------------------------------- +PUT tweets +{ + "mappings": { + "tweet": { + "_field_names": { + "enabled": false + } + } + } +} +-------------------------------------------------- +// CONSOLE