AI OnAI Off
Thanks for replying.
How do i return spelling suggestions?
I actually managed to get it working using this filter i implemented:
public static ITypeSearch<T> FuzzyFilter<T>( this ITypeSearch<T> search, Expression<Func<T, string>> fieldSelector, string almost, double? minSimilarity = null, double? boost = null) { var fieldName = search.Client.Conventions .FieldNameConvention .GetFieldNameForAnalyzed(fieldSelector); var wildcardQuery = new FuzzyQuery(fieldName, almost.ToLowerInvariant()) { MinSimilarity = minSimilarity, Boost = boost }; //Add it to the search request body return new Search<T, WildcardQuery>(search, context => { if (context.RequestBody.Query != null) { var boolQuery = new BoolQuery(); boolQuery.Should.Add(context.RequestBody.Query); boolQuery.Should.Add(wildcardQuery); boolQuery.MinimumNumberShouldMatch = 1; context.RequestBody.Query = boolQuery; } else { context.RequestBody.Query = wildcardQuery; } }); }
Hi Jeppe,
What version of Find/CMS are you using? I had found that same extension for Wildcard search and it was working awesome. At some point after upgrading to latest version of Find, it stopped working. It just returned everything regardless of the query. I am not sure what caused it to stop working. It could have been totally unrelated to the FInd upgrade. I am curious as to what version you are on, as I may be able to rule out the upgrade as the cause of my issue.
Thanks!
John
Hi,
I am trying to implement fuzzy search using episerver find.
I have a page that contains the word "Salmon". If i type the word "Salmin" or "Salmo" i get 0 results. If i type the word "Salmon" i get 10 results which is correct.
But i wonder why i do not get any results if i spell lets say just one character wrong.
Below you can see how i query using episerver find and none of the result sets contains any hits when searching for "Salmin":
And some Fuzzy extensions:
In Episerver find I have seen terms like "ApplyBestBets", "MoreLike", "For" and there is also a "FuzzyQuery". To honest i am a bit confused on what extactly implements fuzzy search. I must be missing something here. Does anyone know what i might do wrong? How to add fuzzy search