Chapter 2. The Improved Query DSL
In the previous chapter, we looked at the overview of Lucene, how it works, how analysis processing is done, and how to use the Apache Lucene query language. In addition to that, we discussed the basic concepts of Elasticsearch. We also introduced Elasticsearch 5.x and covered the latest features introduced in version 2.x as well as 5.x. We also talked about the most important changes/removals of features Elasticsearch has gone through during the transition from 1.x to 5.x. In this chapter, we will dive deep into Elasticsearch, focusing on the Query DSL. We will first go through Lucene similarity algorithm formulas before turning to advanced queries. By the end of this chapter, we will have covered the following topics:
- The changed default text scoring in Lucene: BM25
- Understanding precision and recall
- How BM25 differs from TF-IDF
- Elasticsearch Query DSL
- Understanding bool query syntax
- Which query you should use for your particular use case
- Important...