Skip to content

Commit

Permalink
[Docs] Clarify caveats for phonetic filters replace option
Browse files Browse the repository at this point in the history
The `replace` option in the phonetic token filter can have suprising side
effects, e.g. such as described in elastic#26921. This PR adds a note to be mindful
about such scenarios and offers alternatives to using the `replace` option.

Closes elastic#26921
  • Loading branch information
Christoph Büscher committed Jun 3, 2019
1 parent 56a662e commit 0ce5cef
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/plugins/analysis-phonetic.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ GET phonetic_sample/_analyze

<1> Returns: `J`, `joe`, `BLKS`, `bloggs`

It is important to note that `"replace": false` can lead to unexpected behaviour since
the original and the phonetic version are both kept at the same token location. Some
queries, e.g. the `match` query with applied fuzzyness, ignore one of these two token
versions. This can lead to issues that are difficult to diagnose and reason about.
For this reason, it is often beneficial to use separate fields for analysis with and
without phonetic filtering. That way searches can be run against both fields with differing
boosts and trade-offs (e.g. only run fuzzy queries on the original text field, but not the
phonetic version).

[float]
===== Double metaphone settings
Expand Down

0 comments on commit 0ce5cef

Please sign in to comment.