Chapter 2. Searching Your Data
In the previous chapter we installed and configured our cluster. We also prepared our mappings and indexed our data. We can now do the thing you first had in mind when you chose ElasticSearch, searching! In this chapter you will learn how to query ElasticSearch. Of course, you could say, "Hey, I can just run curl –XGET 'http://localhost:9200/_search?q=first+query'
and get all the data I am interested in", and you would be right. However, ElasticSearch supports a wide variety of queries both simple and complicated. In this chapter we will start to get used to some of the search capabilities that ElasticSearch exposes. By the end of this chapter you will have learned:
How to query ElasticSearch using its Query DSL
How to use basic queries
How to use compound queries
How to filter your results and why it is important
How to change the sorting of your results
How to use scripts in ElasticSearch