title: malformed query, expected [END_OBJECT] but found [FIELD_NAME]
body: <p>The original query looks like this </p>
  
  <pre><code>{
      "query": {
          "bool": {
              "must": [
                  {
                      "has_parent": {
                          "parent_type": "doc",
                          "query": {
                              "bool": {
                                  "must": [
                                      {
                                          "terms": {
                                              "id": [
                                                  713
                                              ]
                                          }
                                      },
                                      {
                                          "range": {
                                              "created": {
                                                  "lte": "now/d"
                                              }
                                          }
                                      },
                                      {
                                          "range": {
                                              "expires": {
                                                  "gte": "now/d"
                                              }
                                          }
                                      }
                                  ]
                              }
                          }
                      }
                  },
                  {
                      "term": {
                          "doc_type": "item"
                      }
                  },
                  {
                      "bool": {
                          "should": [
                              {
                                  "term": {
                                      "have_prices": true
                                  }
                              },
                              {
                                  "term": {
                                      "is_folder": true
                                  }
                              }
                          ]
                      }
                  }
              ],
              "must_not": {
                  "exists": {
                      "field": "folder"
                  }
              }
          }
      },
      "sort": [
          {
              "is_folder": {
                  "order": "desc"
              }
          },
          {
              "title_low.order": {
                  "order": "asc"
              }
          }
      ],
     "size": 1000 
  }
  </code></pre>
  
  <p>And I got some result </p>
  
  <pre><code>"hits": {
          "total": 19,
          "max_score": null,
          "hits": [
              {
                  "_index": "prices",
                  "_type": "doc",
                  "_id": "item-6800004",
                  "_score": null,
                  "_routing": "1",
                  "_source": {
                      "id": 6800004,
                      "id_pricedoc": 713,
                      "title": "\"водка №1\" 1",
                      "title_low": "\"водка №1\" 1",
                      "supplier": {
                          "id": 7831,
                          "type": null
                      },
                      "supplier_nom": {
                          "id": 1375697,
                          "market_nom": {
                              "id": null
                          },
                          "codes": null,
                          "sup_code": "7a6713a5-73c1-3acb-9b62-9e38b2314dce",
                          "manufacturer": {
                              "id": null,
                              "title": null
                          }
                      },
                      "is_folder": false,
                      "folder": null,
                      "path": null,
                      "pricedoc_created": "2016-03-21",
                      "prices": [
                          {
                              "currency": "RUR",
                              "id_offer": 15735967,
                              "id_prcknd": 167,
                              "value": "391.50"
                          }
                      ],
                      "have_prices": true,
                      "market": {
                          "title": null,
                          "uuid": null,
                          "folder": null,
                          "path": null
                      },
                      "_join_field_name": "doc_type",
                      "doc_type": {
                          "name": "item",
                          "parent": "doc-713"
                      }
                  },
                  "sort": [
                      0,
                      "\"водка №1\" 1"
                  ]
              }
  </code></pre>
  
  <p>Now I also would like get result where "id_prcknd": 167</p>
  
  <p>Modified query looks like this </p>
  
  <pre><code>{
      "query": {
          "bool": {
              "must": [
                  {
                      "has_parent": {
                          "parent_type": "doc",
                          "query": {
                              "bool": {
                                  "must": [
                                      {
                                          "terms": {
                                              "id": [
                                                  713
                                              ]
                                          }
                                      },
                                      {
                                          "range": {
                                              "created": {
                                                  "lte": "now/d"
                                              }
                                          }
                                      },
                                      {
                                          "range": {
                                              "expires": {
                                                  "gte": "now/d"
                                              }
                                          }
                                      }
                                  ]
                              }
                          }
                      }
                  },
                  {
                      "term": {
                          "doc_type": "item"
                      }
                  },
                  {
                      "bool": {
                          "should": [
                              {
                                  "term": {
                                      "have_prices": true
                                  }
                              },
                              {
                                  "term": {
                                      "is_folder": true
                                  }
                              }
                          ]
                      }
                  }
              ],
              "must_not": {
                  "exists": {
                      "field": "folder"
                  }
              }
          },
          "nested": {
                  "path": "prices",
                  "query": {
                      "bool": {
                          "must": [
                              {
                                  "match": {
                                      "prices.id_prcknd": 167
                                  }
                              }
                          ]
                      }
                  }
      },
      "sort": [
          {
              "is_folder": {
                  "order": "desc"
              }
          },
          {
              "title_low.order": {
                  "order": "asc"
              }
          }
      ],
     "size": 1000 
  }}
  </code></pre>
  
  <p>But I got an error Elasticsearch malformed query, expected [END_OBJECT] but found [FIELD_NAME]
  Where am I wrong?
  I wanna match objects where "id_prcknd": 167
  The stackoverflow says the I post mostly the code, but it's because of large queries in elastic search.</p>