
ElasticSearch Cookbook
By :

ElasticSearch was born as a search engine. Its main work is to process queries and give results. As we'll see in this recipe, search in ElasticSearch is not only limited to match some documents, but also to calculate additional information required to improve user experience.
You need a working ElasticSearch cluster and an index populated with the script available in the online code.
For searching and evaluating the results, we will perform the steps given as follows:
From command line, we can execute a search using the following command:
curl -XGET 'http://127.0.0.1:9200/test-index/test-type/_search' -d '{"query":{"match_all":{}}}'
In this case we have used a match_all
query that means "return all the documents". We'll discuss this kind of query in the Matching all documents recipe in this chapter.
The command, if everything is all right, will return the following result:
{ "took" : 0, "timed_out" : false, "_shards" : { "total" : 5, ...
Change the font size
Change margin width
Change background colour