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