I can do the elasticsearch half.
A query is a thing that selects documents. They can all be described with
json. The first place you will see one is in the "query" field of the
A filter is just a query that doesn't attempt to rank documents based on
how well the document matched. In 1.x filters were entirely separate from
queries. In 2.x a filter is just a query used in a place where the score
isn't important. The simplest way to make that happen is to wrap a query in
a "constant score" query.
Bool is a specific kind of query for doing boolean logic. It supports
arrays of queries in three fields: must, should, and must_not. Should is
funky because another field, minimum_should_match controls how many queries
in should must match for the document to match the whole bool query. The
reason we use this funky bool thing rather than and/or/not is that it gives
you more power to influence the score of the documents and it is the way
the search is actually performed. It is "closer to the metal".
Search is just an API in elasticsearch that executes queries and returns
documents or aggregations. It is a big, complicated API that makes multiple
round trips to various nodes in the cluster, but it is just an API from a