SaaS CMS has officially launched! Learn more now.

EpiFind - 11 - Not returning the result after 30 characters in search term/query

Vote:
 

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.

Thank you.

Dipak Salve.

#198983
Edited, Nov 12, 2018 12:22
Vote:
 

Looking at the documentation. AnyWordBeginsWith applies in exactly that way, this will match in your example cases such as:

Thi
This i
This is m
This is my tes
This is my test product display name mo

However it will not match in cases such as

This
This is
This 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/

EDIT:

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.

#198990
Edited, Nov 12, 2018 14:16
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.