Incorrect query and I don't understand why

Hello,

I created a query that doesn't work and the kibana devtools is not showing me a syntax error. There must be something logical I missed. I wonder if it comes from the multiples "should" clauses I am using. Could you tell me if you see something incorrect in the following query?

I get this output:

{
  "error": {
    "root_cause": [
      {
        "type": "parsing_exception",
        "reason": "[function_score] malformed query, expected [END_OBJECT] but found [FIELD_NAME]",
        "line": 1071,
        "col": 6
      }
    ],
    "type": "parsing_exception",
    "reason": "[function_score] malformed query, expected [END_OBJECT] but found [FIELD_NAME]",
    "line": 1071,
    "col": 6
  },
  "status": 400
}

Here is the query:

From Elastic Search to Kibana

I found out, it was coming from using should in query.query, which it seems can not be used in the same time with query.function_score.query.bool

Passing everything in query.function_score.query.bool makes it work again

I don't understand why but it works

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