php - Can't use two ore more filters with Elasticsearch -


i'm using elasticsearch in project. elasticsearch query that:

array(     [index] => galaxy     [type] => galaxy     [size] => 1000     [from] => 0     [body] => array(         [query] => array(             [filtered] => array(                 [query] => array(                     [query_string] => array(                         [default_operator] => ,                         [query] => vestel*                     )                 )                 [filter] => array(                     [bool] => array(                         [must] => array(                             [term] => array(                                 [fk_product_category] => 1                                 [fk_product_group] => 1                             )                         )                     )                 )             )         )     ) ) 

when remove 1 of filters terms example fk_product_group works when use both filters fatal error code 400 bad request.

each filter must in own term filter

array(     [index] => galaxy     [type] => galaxy     [size] => 1000     [from] => 0     [body] => array(         [query] => array(             [filtered] => array(                 [query] => array(                     [query_string] => array(                         [default_operator] => ,                         [query] => vestel*                     )                 )                 [filter] => array(                     [bool] => array(                         [must] => array(                             array(                                [term] => array(                                    [fk_product_category] => 1                                )                             ),                             array(                                [term] => array(                                    [fk_product_group] => 1                                )                             )                         )                     )                 )             )         )     ) ) 

Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -