Try our conversational search powered by Generative AI!

Search With BuildFilter



I am trying to search two fields using the BuildFilter extension method but no results are returned.  Here is the code I am using

var placeFilter = client.BuildFilter<Place>();

placeFilter = placeFilter.And(p => p.Name.MatchCaseInsensitive("Name"));
placeFilter = placeFilter.And(p => p.Locality.MatchCaseInsensitive("Locality"));

var place = _findClient.Search<Place>()

Running a search using either one of Name or Locality returns results, when used in an AND query nothing is returned.

Any help would be appreciated.


Apr 12, 2019 16:17

Hi Pa,  Are you using Epi Find?  If so, which version?

Apr 12, 2019 16:42

Hey Bob,

Yes, I am using Episerver Find version 13.03.

Apr 12, 2019 16:47

"using either one of Name or Locality" would suggest you should do an Or filter. An and will only match if both the values of Name AND Locaility match.

If it is an AND you can achieve that in one simple query using an & or even chaining filters as shown here

var place = _findClient.Search<Place>()
.Filter(p => p.Name.MatchCaseInsensitive("Name") & p.Name.MatchCaseInsensitive("Locality"))
Edited, Apr 15, 2019 15:29

School boy error! I had a trailing blank space in my search criteria resulting in zero results being returned.

Apr 17, 2019 12:22
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.