Fuzziness parameter
Fuzziness parameter
Help your users even more with fuzzy search. Use the right fuzziness levels in your app to make it less sensitive to typos.
Sample use case: You occasionally make mistakes when typing. Your app still returns the desired search results.
Use the code snippet below to try this in your app.
-
Level 1 no spell checking
-
Level 2 is using normal n-gram spell checking. For example query "restrant" can be matched to
"restaurant". -
Level 3 is using sound-like spell checking, and shingle spell checking. Sound-like spell checking
is for "rstrnt" to "restaurant" matching. Shingle spell checking is for "mountainview" to
"mountain view" matching. -
Level 4 doesn’t add any more spell checking function.
The search engine will start looking for a match on the level defined by minFuzzyLevel and will
stop searching at the level specified by maxFuzzyLevel.
_
let query = TTSearchQueryBuilder.create(withTerm: term)
.withMinFuzzyLevel(1)
.withMaxFuzzyLevel(maxFuzzyLevel)
.withPosition(locationManager.lastLocation!.coordinate)
.build()
search.search(with: query)
TTSearchQuery *query = [[[[[TTSearchQueryBuilder createWithTerm:term] withMinFuzzyLevel:1] withMaxFuzzyLevel:maxFuzzyLevel] withPosition:self.locationManager.lastLocation.coordinate] build];
[self.search searchWithQuery:query];