From d313d806c37f20d1005eca74aa8a6a7620fa56da Mon Sep 17 00:00:00 2001 From: Carlos Delgado <6339205+carlosdelest@users.noreply.github.com> Date: Tue, 17 Oct 2023 15:50:51 +0200 Subject: [PATCH] Fix synonyms documentation (#100916) --- .../tokenfilters/synonym-graph-tokenfilter.asciidoc | 6 +++--- .../analysis/tokenfilters/synonym-tokenfilter.asciidoc | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/reference/analysis/tokenfilters/synonym-graph-tokenfilter.asciidoc b/docs/reference/analysis/tokenfilters/synonym-graph-tokenfilter.asciidoc index a9bb5b72ea7c3..30be28614d122 100644 --- a/docs/reference/analysis/tokenfilters/synonym-graph-tokenfilter.asciidoc +++ b/docs/reference/analysis/tokenfilters/synonym-graph-tokenfilter.asciidoc @@ -138,7 +138,7 @@ To apply synonyms, you will need to include a synonym graph token filter into an "my_analyzer": { "type": "custom", "tokenizer": "standard", - "filter": ["lowercase", "synonym_graph"] + "filter": ["stemmer", "synonym_graph"] } } ---- @@ -150,8 +150,8 @@ To apply synonyms, you will need to include a synonym graph token filter into an Order is important for your token filters. Text will be processed first through filters preceding the synonym filter before being processed by the synonym filter. -In the above example, text will be lowercased by the `lowercase` filter before being processed by the `synonyms_filter`. -This means that all the synonyms defined there needs to be in lowercase, or they won't be found by the synonyms filter. +{es} will also use the token filters preceding the synonym filter in a tokenizer chain to parse the entries in a synonym file or synonym set. +In the above example, the synonyms graph token filter is placed after a stemmer. The stemmer will also be applied to the synonym entries. The synonym rules should not contain words that are removed by a filter that appears later in the chain (like a `stop` filter). Removing a term from a synonym rule means there will be no matching for it at query time. diff --git a/docs/reference/analysis/tokenfilters/synonym-tokenfilter.asciidoc b/docs/reference/analysis/tokenfilters/synonym-tokenfilter.asciidoc index 91c0a49f41066..ce055d38092ff 100644 --- a/docs/reference/analysis/tokenfilters/synonym-tokenfilter.asciidoc +++ b/docs/reference/analysis/tokenfilters/synonym-tokenfilter.asciidoc @@ -128,7 +128,7 @@ To apply synonyms, you will need to include a synonym token filters into an anal "my_analyzer": { "type": "custom", "tokenizer": "standard", - "filter": ["lowercase", "synonym"] + "filter": ["stemmer", "synonym_graph"] } } ---- @@ -140,8 +140,8 @@ To apply synonyms, you will need to include a synonym token filters into an anal Order is important for your token filters. Text will be processed first through filters preceding the synonym filter before being processed by the synonym filter. -In the above example, text will be lowercased by the `lowercase` filter before being processed by the `synonyms_filter`. -This means that all the synonyms defined there needs to be in lowercase, or they won't be found by the synonyms filter. +{es} will also use the token filters preceding the synonym filter in a tokenizer chain to parse the entries in a synonym file or synonym set. +In the above example, the synonyms graph token filter is placed after a stemmer. The stemmer will also be applied to the synonym entries. The synonym rules should not contain words that are removed by a filter that appears later in the chain (like a `stop` filter). Removing a term from a synonym rule means there will be no matching for it at query time.