I have three properties
User can search for a word that can be in all three properties. I have had this two queries to achieve the desired result
searchTermFilters = searchTermFilters .For(term) .InFields(x => x.Firstname, x => x.Surname, x => x.Username);
searchTermFilters = searchTermFilters .OrFilter(x => x.Firstname.AnyWordBeginsWith(term)) .OrFilter(x => x.Surname.AnyWordBeginsWith(term)) .OrFilter(x => x.Username.AnyWordBeginsWith(term));
The issue is that for both of them it matches exactly. I want something like .Contains in Linq. Any insights?
Hi Mohsin,
You could try below
query = query.For(term, q => { q.Query = $"*{term}*"; }).InField(s => s.Name);
Did you catch this blog post?
https://world.episerver.com/blogs/drew-null/dates/2018/4/find-wildcardquery-and-best-bets---a-workaround/
I have three properties
User can search for a word that can be in all three properties. I have had this two queries to achieve the desired result
The issue is that for both of them it matches exactly. I want something like .Contains in Linq. Any insights?