using WithAndAsDefaultOperator() across several properties

Vote:
 

Hi everyone,

i got an issue trying to setup a search query so that i can use the WithAndAsDefaultOperator() method to work across several properties. Let me explain :

Say the Index contains 3 items as per below :

Item1 : { property1 : "first", property2: "second"}

Item2 : { property1 : "first second", property2: ""}

Item3 : { property1 : "", property2: first "second"}

I would like that searching "first second" returns all 3 items.

My query looks like:

_findClient.Search<Item>()
.For("first second")
.WithAndAsDefaultOperator()
.InField(x => x.Property1)
.InField(x => x.Property2)
GetContentResult()

But that query returns only Item2 and Item3, because it seems that WithAndAsDefaultOperator() applies only within each property searched, but not across properties.

I tried to check with AndInField(), InFields() nethods but with no luck. Ideally i would like to avoid using InAllField(), or having to create a new computed property containing both properties, which means rebuilding the index.

Any idea(s) ?

 

#256779
Jun 18, 2021 3:40
Vote:
 

Ok so it seems that using `UsingSynonyms()` with `WithWithAndAsDefaultOperator()` does not work well.: https://support.episerver.com/hc/en-us/articles/115004105823?input_string=episerver+find+synonym+do+not+work

Planning on using this when we have tie : https://world.episerver.com/blogs/dada/dates/2020/6/improving-synonyms-and-overall-search-experience/

#257042
Jun 24, 2021 7:28
* 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.