Hello,
I'm struggling with the correct operator for this query logic:
I need to match the exact value or to treat it as a null and filter/demote that option
For example i have this data in elastic:
document | field1 | field2 | field3 | field4| field5 |
#1 | must | 10 | 20 | 30 | 40 |
#2 | must | 10 | 50 | null | 40 |
#3 | must | 10 | null | 30 | 90 |
#4 | must | 10 | null | 30 | 100 |
#5 | must | 10 | 20 | null | null |
#6 | must | null | null | null | null |
The user asked for:
field1: must (must be in the document)
field2: 10
field3: 20
field4: 90
field5: 100
Expected scoring result:
document #5 (best)
document #6
all other should be filtered
Behavior should be like this:
When querying a document it should ask every field if the field has the exact data that the user requested or the field is null (with no [other] data), both will be elected, in addition document #5 will get a higher score because that document had a 2/4 fields match which is better then #6 (non matched)
Regards,
Avishai.