In the Basic queries section of this chapter, we discussed the simplest queries exposed by Elasticsearch. However, the simple ones are not the only queries that Elasticsearch provides. The compound queries, as we call them, allow us to connect multiple queries together or alter the behavior of other queries. You may wonder if you need such functionality. A simple exercise to determine this would be to combine a simple
term query with a phrase query in order to get better search results.
bool query allows us to wrap a virtually unbounded number of queries and connect them with a logical value using one of the following sections:
boolquery when wrapped into this section may or may not match—the number ...