Parse Failure [Expected [START_OBJECT] under [filter], but got a [START_ARRAY


(Vincent Gross) #1

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/ecd65c06-e530-4371-8f52-a2a0a6bfa7c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(David Pilato) #2

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 :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 7 août 2014 à 05:37, Vincent Gross 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/ecd65c06-e530-4371-8f52-a2a0a6bfa7c6%40googlegroups.com.
For more options, visit 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/F04D0FDA-E5C5-453B-878F-5ED19C2A5DF9%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.


(system) #3