How to "translate" the "where" clause from sql query to elasticsearch filter

Hello! I'm implementing the filter for the internet shop using elastic
search. I have an EAV model in my RDBMS.

I have a WHERE clause in my SQL query, which have to be translated into the
elasticsearch bool filter.It works just fine in my rdbms.

here's it is:

WHERE (option = "weight" AND value = "50kg")OR (option = "weight" AND value = "500kg")AND (option = "magic" AND value = "no")

I have written the AND filters for inner ANDs of query, but now I need to
put them to the bool filter.

Tried to: (using elastica php library)

$boolFilter = new \Elastica\Filter\Bool();$boolFilter->addShould($innerFilterAnd1);$boolFilter->addShould($innerFilterAnd2);$boolFilter->addMust($innerFilterAnd3);

returns nothing.

Please, help!

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
To view this discussion on the web visit
For more options, visit