One of the most used queries, usually in conjunction with a filter, is Match All Query
. This kind of query allows to returns all the documents.
You need a working ElasticSearch cluster and an index populated with the script available in online code.
For executing the match_all
query, we need to perform the following steps:
From command line, we execute the following query:
curl -XPOST 'http://127.0.0.1:9200/test-index/test-type/_search' -d '{"query":{"match_all":{}}}'
The result returned by ElasticSearch, if everything is all right, should be as follows:
{ "took" : 52, "timed_out" : false, "_shards" : { "total" : 5, "successful" : 5, "failed" : 0 }, "hits" : { "total" : 3, "max_score" : 1.0, "hits" : [ { "_index" : "test-index", "_type" : "test-type", "_id" : "1", "_score" : 1.0, "_source" : {"position": 1, "parsedtext": "Joe Testere nice guy", "name": "Joe Tester", "uuid": "11111...