# \[bool\] malformed query, expected \[END\_OBJECT\] but found \[FIELD\_NAME\]

**URL:** <https://discuss.elastic.co/t/bool-malformed-query-expected-end-object-but-found-field-name/277676>\
**Category:** Elasticsearch\
**Created:** [July 2, 2021, 5:40pm UTC](https://discuss.elastic.co/t/bool-malformed-query-expected-end-object-but-found-field-name/277676 "2021-07-02T17:40:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cherrys](https://avatars.discourse-cdn.com/v4/letter/c/d2c977/32.png) [@Cherrys](https://discuss.elastic.co/u/Cherrys)\
**Post date:** [July 2, 2021, 5:40pm UTC](https://discuss.elastic.co/t/bool-malformed-query-expected-end-object-but-found-field-name/277676/1 "2021-07-02T17:40:21Z")

</div>

```auto
**Request**

POST customer_details/_search
{
 "_source": {
"includes": ["globalName", "customerName","type" ,"container.type"]

},
"query": {
 "bool": {
      "filter": [
        {
            "has_parent":
             {
                "parent_type": "container",
                "query":
                 {
                    "bool": 
                    {
                        "filter":
                         [
                            {
                                "terms":
                                 {
                                    "type": ["compartment","block","room"]
                                }
                            }
                        ]
                    }
                 }
             }
        }  
     ]                  
    },
   
  "match_all": {}
}
}

**Responce**

{
  "error" : {
    "root_cause" : [
      {
        "type" : "parsing_exception",
        "reason" : "[bool] malformed query, expected [END_OBJECT] but found [FIELD_NAME]",
        "line" : 33,
        "col" : 3
      }
    ],
    "type" : "parsing_exception",
    "reason" : "[bool] malformed query, expected [END_OBJECT] but found [FIELD_NAME]",
    "line" : 33,
    "col" : 3
  },
  "status" : 400
}

```

Could some one please suggest me .

---

<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:** [July 30, 2021, 5:41pm UTC](https://discuss.elastic.co/t/bool-malformed-query-expected-end-object-but-found-field-name/277676/2 "2021-07-30T17:41:14Z")

</div>

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