-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Elasticsearch Server: Second Edition

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.
The 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:
should
: The bool
query when wrapped into this section may or may not match—the number of should
sections that have to match is controlled by the minimum_should_match
parameter
must
: The bool
query when wrapped into this section must match in order for the document to be returned
must_not
: The bool
query when wrapped into this section...
Change the font size
Change margin width
Change background colour