Chapter 4. Searching your data

 

This chapter covers

  • The structure of an Elasticsearch search request and response
  • Elasticsearch filters and how they differ from queries
  • Filter bitsets and caching
  • Using queries and filters that Elasticsearch supports

Now that we’ve explored how you get data into Elasticsearch, let’s cover how you get data out of Elasticsearch: by searching. After all, what good is indexing your data into a search engine if you can’t search through it? Fortunately, Elasticsearch provides a rich API for searching through data, running the gamut of Lucene’s search capability. Because of the format Elasticsearch allows for constructing search requests, there are limitless possibilities for how they can be built. The best way to tell which query in combination with filter(s) to use for your data is to experiment, so don’t be afraid to try out these combinations on your project’s data to figure out which one best suits your needs.


4.1. Structure of a search request

4.2. Introducing the query and filter DSL

4.3. Combining queries or compound queries

4.4. Beyond match and filter queries

4.5. Querying for field existence with filters

4.6. Choosing the best query for the job

4.7. Summary

sitemap