elastic / search-ui

Search UI. Libraries for the fast development of modern, engaging search experiences.
https://docs.elastic.co/search-ui
Apache License 2.0
1.92k stars 368 forks source link

Getting back results with score of 0.0 when using a searchTerm #1073

Closed hcarvalhorev closed 2 months ago

hcarvalhorev commented 2 months ago

Hello, I have this problem that I cannot find the reason why but I am using a series of facets and also a search box to filter my results. The facets work as expected. The only problem is with the searchBox that when I enter a search term it adds the following query to the request:

{
  "bool": {
    "should": [
      {
        "multi_match": {
          "query": "SearchBox testing",
          "fields": [
            "title^3"
          ],
          "type": "best_fields",
          "operator": "and"
        }
      },
      {
        "multi_match": {
          "query": "SearchBox testing",
          "fields": [
            "title^3"
          ],
          "type": "cross_fields"
        }
      },
      {
        "multi_match": {
          "query": "SearchBox testing",
          "fields": [
            "title^3"
          ],
          "type": "phrase"
        }
      },
      {
        "multi_match": {
          "query": "SearchBox testing",
          "fields": [
            "title^3"
          ],
          "type": "phrase_prefix"
        }
      }
    ]
  }
}

It comes back as response all the documents in the index but with a score of 0. Shouldn't it not be returning those values? What am I doing wrong?