Hi, So I have a small document where I’m using some facets and filters. They are indexed in atlas search using “string” and “StringFacet” type. The analysers I’ve used for the “string” index is “Keyword analyzer” because I want to match on whole world/phrase and not tokens. The facets are one for subject area and one for degreelevel.
My search stage is defined as follows:
{$search: { index: “default”, compound: { must|mustNot|should|filter } }
The issue:
I generate the compound clause as follows (output log from my golang app)
1:47 Getting compound clause for search stage
2024/04/04 17:31:47 ------------------------------------------------------------------------------------
2024/04/04 17:31:47 Must: [{text [{path title} {query computer}]}]
2024/04/04 17:31:47 Must Not: [{range [{path course_fee.units} {lte 0}]}]
2024/04/04 17:31:47 Should: [{range [{path duration_in_weeks} {gte 0} {lt 52}]}]
2024/04/04 17:31:47 Filter: [{in [{path subject_area} {value [Computer Science and IT]}]} {in [{path degree_level} {value [Bachelor]}]}]
But when I get the results, I also get documents with degree_level Masters.
If I remove the subject_area filter, then I start seeing the right documents again (ie., documents with degree_level Bachelor)
What am I doing wrong?