From 49933a3cb93068518ffc3a907469941a1a02ec69 Mon Sep 17 00:00:00 2001 From: Tim <2527559+svitlo@users.noreply.github.com> Date: Fri, 26 Jul 2024 09:09:44 +0300 Subject: [PATCH 1/4] Update fuzzy.md Corrected the name of the string metric used by default Signed-off-by: Tim <2527559+svitlo@users.noreply.github.com> Signed-off-by: svitlo --- _query-dsl/term/fuzzy.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_query-dsl/term/fuzzy.md b/_query-dsl/term/fuzzy.md index bf2bd43bba..67803276c2 100644 --- a/_query-dsl/term/fuzzy.md +++ b/_query-dsl/term/fuzzy.md @@ -7,7 +7,7 @@ nav_order: 20 # Fuzzy query -A fuzzy query searches for documents containing terms that are similar to the search term within the maximum allowed [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance). The Levenshtein distance measures the number of one-character changes needed to change one term to another term. These changes include: +A fuzzy query searches for documents containing terms that are similar to the search term within the maximum allowed [Damerau–Levenshtein distance](https://en.wikipedia.org/wiki/Damerau-Levenshtein_distance). The Damerau–Levenshtein distance measures the number of one-character changes needed to change one term to another term. These changes include: - Replacements: **c**at to **b**at - Insertions: cat to cat**s** @@ -90,4 +90,4 @@ Specifying a large value in `max_expansions` can lead to poor performance, espec {: .warning} If [`search.allow_expensive_queries`]({{site.url}}{{site.baseurl}}/query-dsl/index/#expensive-queries) is set to `false`, fuzzy queries are not run. -{: .important} \ No newline at end of file +{: .important} From 02c8ec6da4043c5ab8c15ac66c85305812659fe8 Mon Sep 17 00:00:00 2001 From: svitlo Date: Sat, 27 Jul 2024 13:02:16 +0300 Subject: [PATCH 2/4] correct the line 17 of fuzzy.md to clarify the distance name and the role of the field 'transpositions' Signed-off-by: svitlo --- _query-dsl/term/fuzzy.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_query-dsl/term/fuzzy.md b/_query-dsl/term/fuzzy.md index 67803276c2..54c3ab2e08 100644 --- a/_query-dsl/term/fuzzy.md +++ b/_query-dsl/term/fuzzy.md @@ -7,14 +7,14 @@ nav_order: 20 # Fuzzy query -A fuzzy query searches for documents containing terms that are similar to the search term within the maximum allowed [Damerau–Levenshtein distance](https://en.wikipedia.org/wiki/Damerau-Levenshtein_distance). The Damerau–Levenshtein distance measures the number of one-character changes needed to change one term to another term. These changes include: +A fuzzy query searches for documents containing terms that are similar to the search term within the maximum allowed [Damerau–Levenshtein distance](https://en.wikipedia.org/wiki/Damerau–Levenshtein_distance). The Damerau–Levenshtein distance measures the number of one-character changes needed to change one term to another term. These changes include: - Replacements: **c**at to **b**at - Insertions: cat to cat**s** - Deletions: **c**at to at - Transpositions: **ca**t to **ac**t -A fuzzy query creates a list of all possible expansions of the search term that fall within the Levenshtein distance. You can specify the maximum number of such expansions in the `max_expansions` field. Then it searches for documents that match any of the expansions. +A fuzzy query creates a list of all possible expansions of the search term that fall within the Damerau-Levenshtein distance. If you set the `transpositions` field equal to `false`, your search will use the classical [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance). You can specify the maximum number of such expansions in the `max_expansions` field. Then it searches for documents that match any of the expansions. The following example query searches for the speaker `HALET` (misspelled `HAMLET`). The maximum edit distance is not specified, so the default `AUTO` edit distance is used: From 83b32b5a426ae728cf636e2d08b14d0e6ebb8a68 Mon Sep 17 00:00:00 2001 From: svitlo Date: Sat, 27 Jul 2024 13:28:25 +0300 Subject: [PATCH 3/4] correct the line 17 to not break the thought regarding the usage of the field 'max_expansions' Signed-off-by: svitlo --- _query-dsl/term/fuzzy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_query-dsl/term/fuzzy.md b/_query-dsl/term/fuzzy.md index 54c3ab2e08..3d11f2f827 100644 --- a/_query-dsl/term/fuzzy.md +++ b/_query-dsl/term/fuzzy.md @@ -14,7 +14,7 @@ A fuzzy query searches for documents containing terms that are similar to the se - Deletions: **c**at to at - Transpositions: **ca**t to **ac**t -A fuzzy query creates a list of all possible expansions of the search term that fall within the Damerau-Levenshtein distance. If you set the `transpositions` field equal to `false`, your search will use the classical [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance). You can specify the maximum number of such expansions in the `max_expansions` field. Then it searches for documents that match any of the expansions. +A fuzzy query creates a list of all possible expansions of the search term that fall within the Damerau-Levenshtein distance (by the way, if you set the `transpositions` field equal to `false`, your search will use the classical [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance)). You can specify the maximum number of such expansions in the `max_expansions` field. Then it searches for documents that match any of the expansions. The following example query searches for the speaker `HALET` (misspelled `HAMLET`). The maximum edit distance is not specified, so the default `AUTO` edit distance is used: From 6ac0870eaee6bc5f6702f0b2d16ab7bcc4471179 Mon Sep 17 00:00:00 2001 From: Tim <2527559+svitlo@users.noreply.github.com> Date: Tue, 30 Jul 2024 18:14:21 +0300 Subject: [PATCH 4/4] Update _query-dsl/term/fuzzy.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Signed-off-by: Tim <2527559+svitlo@users.noreply.github.com> Signed-off-by: svitlo --- _query-dsl/term/fuzzy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_query-dsl/term/fuzzy.md b/_query-dsl/term/fuzzy.md index 3d11f2f827..7a426fd794 100644 --- a/_query-dsl/term/fuzzy.md +++ b/_query-dsl/term/fuzzy.md @@ -14,7 +14,7 @@ A fuzzy query searches for documents containing terms that are similar to the se - Deletions: **c**at to at - Transpositions: **ca**t to **ac**t -A fuzzy query creates a list of all possible expansions of the search term that fall within the Damerau-Levenshtein distance (by the way, if you set the `transpositions` field equal to `false`, your search will use the classical [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance)). You can specify the maximum number of such expansions in the `max_expansions` field. Then it searches for documents that match any of the expansions. +A fuzzy query creates a list of all possible expansions of the search term that fall within the Damerau-Levenshtein distance. You can specify the maximum number of such expansions in the `max_expansions` field. The query then searches for documents that match any of the expansions. If you set the `transpositions` parameter to `false`, then your search will use the classic [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance). The following example query searches for the speaker `HALET` (misspelled `HAMLET`). The maximum edit distance is not specified, so the default `AUTO` edit distance is used: