From 26cc8ff8c3664e059071dc9ed539296b83e9e61a Mon Sep 17 00:00:00 2001 From: Alan Woodward Date: Wed, 21 Nov 2018 15:27:11 +0000 Subject: [PATCH] Add pointer to the index-phrases option in shingle filter docs (#35771) We should be discouraging the use of shingle filters and instead pointing users to the index-phrases parameter on text fields. --- .../analysis/tokenfilters/shingle-tokenfilter.asciidoc | 4 ++++ docs/reference/mapping/params.asciidoc | 3 +++ docs/reference/mapping/params/index-phrases.asciidoc | 8 ++++++++ docs/reference/mapping/types/text.asciidoc | 2 +- 4 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 docs/reference/mapping/params/index-phrases.asciidoc diff --git a/docs/reference/analysis/tokenfilters/shingle-tokenfilter.asciidoc b/docs/reference/analysis/tokenfilters/shingle-tokenfilter.asciidoc index 386b45559fd..a6d544fc7b3 100644 --- a/docs/reference/analysis/tokenfilters/shingle-tokenfilter.asciidoc +++ b/docs/reference/analysis/tokenfilters/shingle-tokenfilter.asciidoc @@ -1,6 +1,10 @@ [[analysis-shingle-tokenfilter]] === Shingle Token Filter +NOTE: Shingles are generally used to help speed up phrase queries. Rather +than building filter chains by hand, you may find it easier to use the +<> option on a text field. + A token filter of type `shingle` that constructs shingles (token n-grams) from a token stream. In other words, it creates combinations of tokens as a single token. For example, the sentence "please divide this diff --git a/docs/reference/mapping/params.asciidoc b/docs/reference/mapping/params.asciidoc index e33fac6de5d..b0fcc53fe1c 100644 --- a/docs/reference/mapping/params.asciidoc +++ b/docs/reference/mapping/params.asciidoc @@ -21,6 +21,7 @@ The following mapping parameters are common to some or all field datatypes: * <> * <> * <> +* <> * <> * <> * <> @@ -63,6 +64,8 @@ include::params/index.asciidoc[] include::params/index-options.asciidoc[] +include::params/index-phrases.asciidoc[] + include::params/multi-fields.asciidoc[] include::params/norms.asciidoc[] diff --git a/docs/reference/mapping/params/index-phrases.asciidoc b/docs/reference/mapping/params/index-phrases.asciidoc new file mode 100644 index 00000000000..f32cc7c988c --- /dev/null +++ b/docs/reference/mapping/params/index-phrases.asciidoc @@ -0,0 +1,8 @@ +[[index-phrases]] +=== Index Phrases + +If enabled, two-term word combinations ('shingles') are indexed into a separate +field. This allows exact phrase queries (no slop) to run more efficiently, at the expense +of a larger index. Note that this works best when stopwords are not removed, +as phrases containing stopwords will not use the subsidiary field and will fall +back to a standard phrase query. Accepts `true` or `false` (default). \ No newline at end of file diff --git a/docs/reference/mapping/types/text.asciidoc b/docs/reference/mapping/types/text.asciidoc index db64e87412e..f412db11848 100644 --- a/docs/reference/mapping/types/text.asciidoc +++ b/docs/reference/mapping/types/text.asciidoc @@ -96,7 +96,7 @@ The following parameters are accepted by `text` fields: the expense of a larger index. Accepts an <> -`index_phrases`:: +<>:: If enabled, two-term word combinations ('shingles') are indexed into a separate field. This allows exact phrase queries (no slop) to run more efficiently, at the expense