I'm creating a condition for the segment builder inheriting from TypedQueryableStringOperatorCondition
.
I'm overriding the method GetResultPredicate
to apply my filter like this
return base.GetCompareExpression((IndexedContact c) => c["contact.myfield"], "myvalue");
This is translated into the following query:
contact.myfield:myvalue
So good so far, but if the value I'm looking for has more than one word or pipe to split terms it adds double quotes to the query:
return base.GetCompareExpression((IndexedContact c) => c["contact.myfield"], "my value");
This is translated into the following query:
contact.myfield:"my value"
In my case the query I'm trying to get is:
contact.myfield:my value
To get result containing "my" or "value"
I have tried using the Operator contains, but it has been translated into a massive spanNear([SpanWildcardQuery
.
Any idea how to achieve the query:
contact.myfield:my value
Trying to make it easier or clearer what I'm really trying to do is to find contacts containing any of the "words" in that field. It's fine If I have to change the approach.
contact.myfield:"my value"
? To me it looks like the more correct syntax.Equals
etc....