# Parse Failure \[Expected \[START\_OBJECT\] under \[filter\], but got a \[START\_ARRAY

**URL:** <https://discuss.elastic.co/t/parse-failure-expected-start-object-under-filter-but-got-a-start-array/19129>\
**Category:** Elasticsearch\
**Created:** [August 7, 2014, 3:37am UTC](https://discuss.elastic.co/t/parse-failure-expected-start-object-under-filter-but-got-a-start-array/19129 "2014-08-07T03:37:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vincent\_Gross](https://avatars.discourse-cdn.com/v4/letter/v/ba8739/32.png) [@Vincent\_Gross](https://discuss.elastic.co/u/Vincent_Gross)\
**Post date:** [August 7, 2014, 3:37am UTC](https://discuss.elastic.co/t/parse-failure-expected-start-object-under-filter-but-got-a-start-array/19129/1 "2014-08-07T03:37:44Z")

</div>

I've tried to upgrade the version of ES yesterday (from 1.1.1 to 1.3.1) and  
I have an Issue when I try to use a complexe query with Aggregation.

Parse Failure [Expected [START\_OBJECT] under [filter], but got a  
[START\_ARRAY

I've this bug since the version 1.2.0 (I've tried all the version after  
this version and I have this bug).

My system is very complexe and this bug comes from a filter on a  
Aggregation. I don't have enough time to expose my mapping and all the  
needs to reproduce the bug sorry about that. For my application I'd to  
downgrade my version to 1.1.2 to have my project working well.

I've opened an issue on Github and it was close I don't understand why ? I  
still have my issue...

Here my query (in my Application I use the official php client of elastic  
search):

{

"index":"dailysnapshot\_201406",

"type":"dailysnapshot",

"body":{

```
  "size":0,

  "query":{  

     "filtered":{  

        "filter":{  

           "bool":{  

              "must":[  

                 {  

                    "term":{  

                       "is_mam":false

                    }

                 },

                 {  

                    "term":{  

                       "datetime":"20140619"

                    }

                 }

              ],

              "_cache":true

           }

        }

     }

  },

  "aggs":{  

     "x_book":{  

        "filter":[  

           {  

              "term":{  

                 "book.raw":"X"

              }

           }

        ],

        "aggs":{  

           "unrealised_x_sum":{  

              "sum":{  

                 "field":"unrealised_change_aud"

              }

           },

           "closed_x_sum":{  

              "sum":{  

                 "field":"closed_profit_aud"

              }

           },

           "ib_x_sum":{  

              "sum":{  

                 "field":"agent_commission_aud"

              }

           },

           "pnl_x_sum":{  

              "sum":{  

                 "field":"daily_profit_aud"

              }

           }

        }

     },

     "s_book":{  

        "filter":[  

           {  

              "term":{  

                 "book.raw":"S"

              }

           }

        ],

        "aggs":{  

           "unrealised_s_sum":{  

              "sum":{  

                 "field":"unrealised_change_aud"

              }

           },

           "closed_s_sum":{  

              "sum":{  

                 "field":"closed_profit_aud"

              }

           },

           "ib_s_sum":{  

              "sum":{  

                 "field":"agent_commission_aud"

              }

           },

           "pnl_s_sum":{  

              "sum":{  

                 "field":"daily_profit_aud"

              }

           }

        }

     }

  }

```

}

}

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/ecd65c06-e530-4371-8f52-a2a0a6bfa7c6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ecd65c06-e530-4371-8f52-a2a0a6bfa7c6%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [August 7, 2014, 6:05am UTC](https://discuss.elastic.co/t/parse-failure-expected-start-object-under-filter-but-got-a-start-array/19129/2 "2014-08-07T06:05:09Z")

</div>

This is incorrect:

```
     "x_book":{  

        "filter":[  

           {  

              "term":{  

                 "book.raw":"X"

              }

           }

        ],

```

It should be

```
     "x_book":{  

        "filter":{

           {  

              "term":{  

                 "book.raw":"X"

              }

           }

        },

```

So it's not an elasticsearch issue. It's an error in your code.  
That's why I closed your "issue".

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 7 août 2014 à 05:37, Vincent Gross [vincent.gross@pepperstone.com](mailto:vincent.gross@pepperstone.com) a écrit :

I've tried to upgrade the version of ES yesterday (from 1.1.1 to 1.3.1) and I have an Issue when I try to use a complexe query with Aggregation.

Parse Failure [Expected [START\_OBJECT] under [filter], but got a [START\_ARRAY

I've this bug since the version 1.2.0 (I've tried all the version after this version and I have this bug).

My system is very complexe and this bug comes from a filter on a Aggregation. I don't have enough time to expose my mapping and all the needs to reproduce the bug sorry about that. For my application I'd to downgrade my version to 1.1.2 to have my project working well.

I've opened an issue on Github and it was close I don't understand why ? I still have my issue...

Here my query (in my Application I use the official php client of elastic search):

{

"index":"dailysnapshot\_201406",

"type":"dailysnapshot",

"body":{

```
  "size":0,

  "query":{  

     "filtered":{  

        "filter":{  

           "bool":{  

              "must":[  

                 {  

                    "term":{  

                       "is_mam":false

                    }

                 },

                 {  

                    "term":{  

                       "datetime":"20140619"

                    }

                 }

              ],

              "_cache":true

           }

        }

     }

  },

  "aggs":{  

     "x_book":{  

        "filter":[  

           {  

              "term":{  

                 "book.raw":"X"

              }

           }

        ],

        "aggs":{  

           "unrealised_x_sum":{  

              "sum":{  

                 "field":"unrealised_change_aud"

              }

           },

           "closed_x_sum":{  

              "sum":{  

                 "field":"closed_profit_aud"

              }

           },

           "ib_x_sum":{  

              "sum":{  

                 "field":"agent_commission_aud"

              }

           },

           "pnl_x_sum":{  

              "sum":{  

                 "field":"daily_profit_aud"

              }

           }

        }

     },

     "s_book":{  

        "filter":[  

           {  

              "term":{  

                 "book.raw":"S"

              }

           }

        ],

        "aggs":{  

           "unrealised_s_sum":{  

              "sum":{  

                 "field":"unrealised_change_aud"

              }

           },

           "closed_s_sum":{  

              "sum":{  

                 "field":"closed_profit_aud"

              }

           },

           "ib_s_sum":{  

              "sum":{  

                 "field":"agent_commission_aud"

              }

           },

           "pnl_s_sum":{  

              "sum":{  

                 "field":"daily_profit_aud"

              }

           }

        }

     }

  }

```

}

}

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/ecd65c06-e530-4371-8f52-a2a0a6bfa7c6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ecd65c06-e530-4371-8f52-a2a0a6bfa7c6%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/F04D0FDA-E5C5-453B-878F-5ED19C2A5DF9%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/F04D0FDA-E5C5-453B-878F-5ED19C2A5DF9%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 1:10am UTC](https://discuss.elastic.co/t/parse-failure-expected-start-object-under-filter-but-got-a-start-array/19129/3 "2017-07-06T01:10:17Z")

</div>


