Chapter 5. Search

In this chapter, we will cover the following recipes:

  • Executing a search
  • Sorting results
  • Highlighting results
  • Executing a scrolling query
  • Using the search_after functionality
  • Returning inner hits in results
  • Suggesting a correct query
  • Counting matched results
  • Explaining a query
  • Query profiling
  • Deleting by query
  • Updating by query
  • Matching all the documents
  • Using a Boolean query

Introduction

Now we have set the mappings and put the data in the indices, we can search.

In this chapter, we will cover the search using different factors: sorting, highlighting, scrolling, suggesting, counting, and deleting. These actions are the core part of Elasticsearch: ultimately, everything in Elasticsearch is about serving the query and returning good-quality results. ...

Get Elasticsearch 5.x Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.