Elasticsearch queries are great - the query DSL is very rich and keeps evolving continuously. It's hierarchical structure allows for very sophisticated queries to be written and executed, and for handy UIs to wrap it with auto-complete features, for example.
However, like with every DSL, Elasticsearch's has sweet spots and pitfalls. Perhaps the most important thing to know about Elasticsearch's DSL is that every type of query boils down to a set of Term Queries and Boolean Queries. For example, a Range Query will essentially be an aggregated query for all the terms between the two specified values (the
lt values - the
to of the range); many TermQuerys chained in a BoolQuery's should clause.
In fact, **this should be tau...