using WithAndAsDefaultOperator() across several properties


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:

.For("first second")
.InField(x => x.Property1)
.InField(x => x.Property2)

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) ?


Jun 18, 2021 3:40

Ok so it seems that using `UsingSynonyms()` with `WithWithAndAsDefaultOperator()` does not work well.:

Planning on using this when we have tie :

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.