Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this change?
This introduces the ability to allow fuzziness in basic searching (i.e. text typed into the search bar, but not chips) to help when users have spelling errors in their search terms
The fuzziness can be switched on and off via an api config parameter and some of the variables controlling the behaviour of fuzziness have also been exposed;
search.fuzziness.enabled : Boolean = true/false (default = false) <-- will fuzziness be activated
search.fuzziness.prefixLength : Int = 0...x (default = 1) <-- how many of the initial characters must be exact match
search.fuzziness.editDistance : String = AUTO or AUTO:short,med or [1,2,3,4] (default: AUTO) <-- sets the allowed edit distance, in case of AUTO this sets the edit distance based on search token length, AUTO:short,med configures the word length boundary for exact matches and single edit or double edit word legnths
search.fuzziness.maxExpansions : Int = 0..x (default = 50) <-- max number of variations created.
For more details see https://www.elastic.co/guide/en/elasticsearch/reference/7.17/query-dsl-fuzzy-query.html
Fuzzy search is only applied to Word queries e.g. Lightroom Develop and not Phrase queries e.g. "Lightroom Develop" (wrapped in quotes) as multi-match queries are treated as exact term match.
Note the intrioduction of fuzziness changes the search structure from 'cross-fields' to 'best-field' - this means that all the words/tokens searched for need to all appear in one of the searched fields rather than being able to appear across the range of searched fields.
If doument is;
{
title: 'red fox',
description: 'jumped over the dog'
}
a cross-field search for "red fox" will match this document but a best-field search will not - the document would need to have the description: 'red fox jumped over the dog' for a match to be found via best-field.
How should a reviewer test this change?
Ensure that the search results match up as expected given the chosen search parameters
Who should look at this?
Tested? Documented?