Query/filter API for Elasticsearch based on abstract syntax tree