Cant understant this bad response

Hello, I have implemented my custom search function. All tests have passed, but when I run request on Kibana, I get this response:

{
  "error" : {
    "root_cause" : [
      {
        "type" : "parsing_exception",
        "reason" : "unknown query [function_score] did you mean any of [random_score, script_score]?",
        "line" : 30,
        "col" : 38
      }
    ],
    "type" : "x_content_parse_exception",
    "reason" : "[30:38] [bool] failed to parse field [must]",
    "caused_by" : {
      "type" : "parsing_exception",
      "reason" : "unknown query [function_score] did you mean any of [random_score, script_score]?",
      "line" : 30,
      "col" : 38,
      "caused_by" : {
        "type" : "named_object_not_found_exception",
        "reason" : "[30:38] unknown field [similar_score]"
      }
    }
  },
  "status" : 400
}

#request
    GET vectors/_search
    {
       "query": {
    "bool": {
      "must": [
        {
          "nested": {
            "inner_hits": {
              "size": 1,
              "sort": {
                "_score": "asc"
              }
            },
            "score_mode": "min",
            "path": "vectors",
            "query": {
              "function_score": {
                "query": {
                  "bool": {
                    "filter": [
                      {
                        "exists": {
                          "field": "vectors"
                        }
                      }
                    ]
                  }
                },
                "functions": [
                  {
                    "similar_score": {
                      "vectors.value": {
                        "value": "vid5oJoN5KC+D+igvid5oJpdRpKaXUaavi94oL4PaKCKWUaSiglEopoN5KCaXUaSml1GkpoNRqK+L/igml1GklpEexS4tTeZ6OgYIrsBWgwadDVHUnL23t4igFrcU040pPuYhZTGlV/Sju7AXHOFRpTtiDtbaSMn+qlofM/+LeaX07R1cUT9/mLQroBhdHeO5uJCrd6fdV1tWoJfW2MCvtkXkaDsJWiEKa3eZEEh8wbKay94ow2xERoZ8gW3Ko8axR60IbFCpCff4r1m8ivDgT0kOvcnsX1HsMMJ3dcv0h0=",
                        "components": [
                          {
                            "size": 64,
                            "weight": 1
                          },
                          {
                            "size": 64,
                            "weight": 1
                          },
                          {
                            "size": 64,
                            "weight": 1
                          },
                          {
                            "size": 32,
                            "weight": 1
                          }
                        ]
                      }
                    }
                  }
                ]
              }
            }
          }
        }
      ]
    }
      }
    }

ES version: 7.9.0
Lucene verison: 8.6.0

What is similar_score as a part of a function of function_score query?

function_score query supports only certain functions and similar_score is not one of them.

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