8 Introducing search

 

This chapter covers

  • Fundamentals of search
  • Types of search methods
  • Introduction to Query DSL
  • Common search features

It is time to enter the world of search. So far, we’ve looked at priming Elasticsearch with data, and the last chapter discussed the mechanics of how text fields are analyzed. We got a taste of searching data using a set of queries, but we didn’t look at searching in depth or the nitty-gritty of search variants. Chapters 8 through 12 are dedicated to search.

Search is the core functionality of Elasticsearch and answers user queries efficiently and effectively. Once data is indexed and available for search, users can ask various questions. For example, if our fictitious online bookstore’s website search is powered by Elasticsearch, we can expect many queries from clients. They may range from simple queries like finding a book based on a title search word to complex queries searching for books that match multiple criteria: a particular edition, published between a range of dates, hardbound, review rating higher than 4.5 out of 5, price less than a certain amount, and so on. The UI may support various widgets such as dropdowns, sliders, check boxes, and so forth to enable filtering the search even further.

8.1 Overview

8.2 How does search work?

8.3 Movie sample data

8.4 Search fundamentals

8.4.1 The _search endpoint

8.4.2 Query vs. filter context

8.5 Anatomy of a request and a response

8.5.1 Search requests

8.5.2 Search responses

8.6 URI request searches

8.6.1 Searching for movies by title