0

I have an Atlas Search index that covers multiple fields and also uses a couple synonyms. I am getting an error when I try to use synonyms in the mustNot. Is this error telling me I am not able to use synonyms in the mustNot part of the compound? Any suggestions on how to work around this?

MongoServerError: Remote error from mongot :: caused by :: Cannot call docFreq() when needsStats=false

 {
                    '$search': {
                        "index": "default",
                        "compound": {
                          "must": [{
                            "text" : {
                              "query": "NY",
                              "path" : "state",
                              "synonyms": "synonyms_state"
                            }
                            },
                          ],
                          "mustNot": [{
                            "text" : {
                              "query": 'NYC',
                              "path" : "city",
                              "synonyms": "synonyms_city"
                            }
                          }]
                      }
                    }
                }
eurodollars
  • 47
  • 1
  • 8

1 Answers1

0

As of 2/28/2022 MongoDB support is aware of the issue and is planning on releasing a fix at some point.

eurodollars
  • 47
  • 1
  • 8