4.7. Summary

Filters can speed up queries by skipping over the scoring calculations and by caching. In this chapter you learned the following:

Human-language type queries, such as the match and query_string queries, are suitable for search boxes.

The match query is the go-to query for full-text search, but the query_string query is both more flexible and more complex because it exposes the full Lucene query syntax.

The match query has multiple subtypes: boolean, phrase, and phrase_prefix. The main difference is that boolean matches individual words, whereas the phrase types take the order of words into account, as if they were in a phrase.

Specialized queries such as the prefix and wildcard queries are also supported.

To filter documents where a field doesn’t exist, use the missing filter.

The exists filter does the exact opposite; it returns only documents having the specified field value.

Other types of queries are available that allow you to tune your relevance. We’ll discuss them in chapter 6. Matching results and their relevance is heavily influenced by how the text is analyzed. Chapter 5 covers the details of analysis.