I am using elasticsearch 2.3.3. I have indexed 3 documents which i want to scroll.
To get a scrollId i send:
curl -XGET 'localhost:8082/entities_alias/entity/_search?scroll=1m&pretty' -d '
{
"query": {
"match_all": {}
}
}
'
which returns me a scrollId and my 3 hits
{
"_scroll_id" : "cXVlcnlUaGVuRmV0Y2g7NTsyNjo1dTNEWk55TlJONjgwX1FBY2s1VlZ3OzI4OjV1M0RaTnlOUk42ODBfUUFjazVWVnc7Mjc6NXUzRFpOeU5STjY4MF9RQWNrNVZWdzszMDo1dTNEWk55TlJONjgwX1FBY2s1VlZ3OzI5OjV1M0RaTnlOUk42ODBfUUFjazVWVnc7MDs=",
"took" : 3,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 3,
"max_score" : 1.0,
"hits" : [ {
"_index" : "entities",
"_type" : "entity",
"_id" : "PIRlWdgfNrzHUNhA",
"_score" : 1.0,
"_source" : {
"id" : "PIRlWdgfNrzHUNhA",
"parent_id" : null,
"contentmodel_id" : "level1", ...
...
Then i try to scroll by calling
curl -XGET 'localhost:8082/_search/scroll' -d'
{
"scroll" : "1m",
"scroll_id" : "cXVlcnlUaGVuRmV0Y2g7NTsyNjo1dTNEWk55TlJONjgwX1FBY2s1VlZ3OzI4OjV1M0RaTnlOUk42ODBfUUFjazVWVnc7Mjc6NXUzRFpOeU5STjY4MF9RQWNrNVZWdzszMDo1dTNEWk55TlJONjgwX1FBY2s1VlZ3OzI5OjV1M0RaTnlOUk42ODBfUUFjazVWVnc7MDs="
}
'
which returns me
{
"_scroll_id" : "cXVlcnlUaGVuRmV0Y2g7NTsyNjo1dTNEWk55TlJONjgwX1FBY2s1VlZ3OzI4OjV1M0RaTnlOUk42ODBfUUFjazVWVnc7Mjc6NXUzRFpOeU5STjY4MF9RQWNrNVZWdzszMDo1dTNEWk55TlJONjgwX1FBY2s1VlZ3OzI5OjV1M0RaTnlOUk42ODBfUUFjazVWVnc7MDs=",
"took" : 2,
"timed_out" : false,
"terminated_early" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 3,
"max_score" : 1.0,
"hits" : [ ]
}
}
So totalHits is 3 but hits[] is empty. How can i get the Hits for my scroll?