This was working on 7.6.2 but since upgrading to 7.7 it has stopped working and do not know why?
I am doing a query with a nested or with a nested must so it has to be 5 5 5 or 6 6 6 on three columns.
I am using the laravel scout driver for elastic search babenkoivan/scout-elasticsearch-driver
Thanks :)!
  "query": {
    "bool": {
      "must": [
        {
          "bool": {
            "should": [
              {
                "bool": {
                  "must": [
                    [
                      {
                        "term": {
                          "section": "205"
                        }
                      },
                      {
                        "term": {
                          "profile": "40"
                        }
                      },
                      {
                        "term": {
                          "rim_size": "17"
                        }
                      }
                    ]
                  ]
                }
              }
            ]
          }
        },
        {
          "bool": {
            "should": [
              [
                {
                  "term": {
                    "supplier_id": 3
                  }
                }
              ]
            ]
          }
        }
      ]
    }
  },
Error:
{
   "error":{
      "root_cause":[
         {
            "type":"x_content_parse_exception",
            "reason":"[1:106] [bool] failed to parse field [must]"
         }
      ],
      "type":"x_content_parse_exception",
      "reason":"[1:106] [bool] failed to parse field [must]",
      "caused_by":{
         "type":"x_content_parse_exception",
         "reason":"[1:106] [bool] failed to parse field [should]",
         "caused_by":{
            "type":"x_content_parse_exception",
            "reason":"[1:106] [bool] failed to parse field [must]",
            "caused_by":{
               "type":"illegal_state_exception",
               "reason":"expected value but got [START_ARRAY]"
            }
         }
      }
   },
   "status":400
}
                You have two nested arrays in your bool/must, you need to remove one:
              "must": [
      >>>       [
                  {
                    "term": {
                      "section": "205"
                    }
                  },
                  {
                    "term": {
                      "profile": "40"
                    }
                  },
                  {
                    "term": {
                      "rim_size": "17"
                    }
                  }
      >>>       ]
              ]
It should look like this instead:
              "must": [
                  {
                    "term": {
                      "section": "205"
                    }
                  },
                  {
                    "term": {
                      "profile": "40"
                    }
                  },
                  {
                    "term": {
                      "rim_size": "17"
                    }
                  }
              ]
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With