I am trying out elastic search for the first time. I just have 1 node and 1 index.
curl -XPUT http://localhost:9200/testing/dummy/1 -d '{
"snapshotTime" : "2012-10-31T13:31:21",
"ratio" : "50",
"description" : "sample description"
}'
I have indexed 500 such dummies to index ‘testing’.
http://localhost:9200/testing/dummy/1
.
.
.
.
http://localhost:9200/testing/dummy/500
Now, when I tried a matchAll query with this data set,
curl -XGET 'http://localhost:9202/_all/_search?pretty=true' -d '
{
"query" : {
"matchAll" : {}
}
}'
I get back only 10 results and they are random every time. However, the total hits remain 500. The hits array only contain 10 entries. Am I missing something?
I got the answer from elastic search users mailing list. (Credits: Radu Gheorghe)
http://www.elasticsearch.org/guide/reference/api/search/from-size.html
The from/size in the search API allows to control the result set size.