I have following code to filter/search the result.
search = search.Filter(m => m.Code.MatchCaseInsensitive(productFilters.Query) |m.Name.AnyWordBeginsWith(productFilters.Query) |m.DisplayName.AnyWordBeginsWith(productFilters.Query) |m.ProductDescription.ToString().AnyWordBeginsWith(productFilters.Query) |m.SearchKeywords.AnyWordBeginsWith(productFilters.Query));
Search is not returning result if productFilters.Query contains more than 30 characters.
E.g. There is product with display name "This is my test product display name more than 30 chars", If I searched for tearm/query "This is my test product displ", gives me perfect result. But after that if search term/query "This is my test product display", then no result. Can anyone help me out please.
Looking at the documentation. AnyWordBeginsWith applies in exactly that way, this will match in your example cases such as:ThiThis iThis is mThis is my tesThis is my test product display name mo
However it will not match in cases such asThisThis isThis is my test product display
I'm sure someone else will be able to provide a more thorough explaination however this is what I've managed to grasp when reviewing the section "Matching by beginning of any word (wildcard, autocomplete)" from here:https://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-Find/8/DotNET-Client-API/Searching/Filtering/Strings/
To add to this you may find the Prefix/PrefixCaseInsensitive methods suit your case more appropriately if the intention is to match from the beginning of the whole string.