# Cant understant this bad response

**URL:** <https://discuss.elastic.co/t/cant-understant-this-bad-response/252806>\
**Category:** Elasticsearch\
**Created:** [October 21, 2020, 8:48am UTC](https://discuss.elastic.co/t/cant-understant-this-bad-response/252806 "2020-10-21T08:48:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Borna\_Jelic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/borna_jelic/32/77597_2.png) [@Borna\_Jelic](https://discuss.elastic.co/u/Borna_Jelic)\
**Post date:** [October 21, 2020, 8:48am UTC](https://discuss.elastic.co/t/cant-understant-this-bad-response/252806/1 "2020-10-21T08:48:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mayya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mayya/32/83147_2.png) [@mayya](https://discuss.elastic.co/u/mayya)\
**Post date:** [October 21, 2020, 9:13pm UTC](https://discuss.elastic.co/t/cant-understant-this-bad-response/252806/2 "2020-10-21T21:13:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 18, 2020, 9:13pm UTC](https://discuss.elastic.co/t/cant-understant-this-bad-response/252806/3 "2020-11-18T21:13:54Z")

</div>

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