Search Score of 0.0

I have the following query:

[
  {
    "$search": {
      "compound": {
        "should": [
          {
            "phrase": {
              "query": "test phrase",
              "path": {
                "wildcard": "*"
              }
            }
          }
        ],
        "filter": [
          {
            "text": {
              "path": "owner",
              "query": "owner_id_redacted"
            }
          }
        ]
      }
    }
  },
  {
    "$project": {
      "score": {
        "$meta": "searchScore"
      },
      "desc": 1
    }
  }
]

I’m expecting 1 result in my test. I have several results. The first one has a search score of 10.557… The rest of the results (which are many) all have search scores of 0.0. Why are these being included and how can I filter them out of the results?

Nevermind. I found the minimumShouldMatch option in the docs. Working better now.

3 Likes

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.