{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch/issues/11419","labels_url":"https://api.github.com/repos/elastic/elasticsearch/issues/11419/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/11419/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/11419/events","html_url":"https://github.com/elastic/elasticsearch/issues/11419","id":82430323,"number":11419,"title":"Scroll scan query doesn't return all documents.","user":{"login":"developmentstudio","id":5364555,"avatar_url":"https://avatars.githubusercontent.com/u/5364555?v=3","gravatar_id":"","url":"https://api.github.com/users/developmentstudio","html_url":"https://github.com/developmentstudio","followers_url":"https://api.github.com/users/developmentstudio/followers","following_url":"https://api.github.com/users/developmentstudio/following{/other_user}","gists_url":"https://api.github.com/users/developmentstudio/gists{/gist_id}","starred_url":"https://api.github.com/users/developmentstudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/developmentstudio/subscriptions","organizations_url":"https://api.github.com/users/developmentstudio/orgs","repos_url":"https://api.github.com/users/developmentstudio/repos","events_url":"https://api.github.com/users/developmentstudio/events{/privacy}","received_events_url":"https://api.github.com/users/developmentstudio/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-29T13:35:23Z","updated_at":"2015-05-29T13:50:39Z","closed_at":null,"body":"Hi all, At the moment I am trying to scan and scroll my ES index to export all the data, but I noticed that not always all the documents are returned. In other words ES says I have 1.115.857 documents in my index, but my export contains 1.049.191 documents. Testing with an index with up to 900.000 document is working fine. Somebody that can explain this behavior?\r\n\r\nES is running on a CentOS machine with 6GB of RAM with a ES_HEAP_SIZE of 3GB."},"comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/issues/comments/106807750","html_url":"https://github.com/elastic/elasticsearch/issues/11419#issuecomment-106807750","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/11419","id":106807750,"user":{"login":"developmentstudio","id":5364555,"avatar_url":"https://avatars.githubusercontent.com/u/5364555?v=3","gravatar_id":"","url":"https://api.github.com/users/developmentstudio","html_url":"https://github.com/developmentstudio","followers_url":"https://api.github.com/users/developmentstudio/followers","following_url":"https://api.github.com/users/developmentstudio/following{/other_user}","gists_url":"https://api.github.com/users/developmentstudio/gists{/gist_id}","starred_url":"https://api.github.com/users/developmentstudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/developmentstudio/subscriptions","organizations_url":"https://api.github.com/users/developmentstudio/orgs","repos_url":"https://api.github.com/users/developmentstudio/repos","events_url":"https://api.github.com/users/developmentstudio/events{/privacy}","received_events_url":"https://api.github.com/users/developmentstudio/received_events","type":"User","site_admin":false},"created_at":"2015-05-29T13:50:39Z","updated_at":"2015-05-29T13:50:39Z","body":"Hi @nik9000,\r\n\r\nStarting the scroll/scan query with the query below return a count.\r\n\r\n```\r\nGET /20141016v3small/accesslog/_search?search_type=scan&scroll=10m\r\n```\r\nResults in 1115857 documents.\r\n\r\n```\r\n{\r\n   \"_scroll_id\": \"c2Nhbjs1OzMxMjpQdFFGVFhwTVJ2YXl5T2tjZkNYMUpROzMxNDpQdFFGVFhwTVJ2YXl5T2tjZkNYMUpROzMxNTpQdFFGVFhwTVJ2YXl5T2tjZkNYMUpROzMxMzpQdFFGVFhwTVJ2YXl5T2tjZkNYMUpROzMxMTpQdFFGVFhwTVJ2YXl5T2tjZkNYMUpROzE7dG90YWxfaGl0czoxMTE1ODU3Ow==\",\r\n   \"took\": 6,\r\n   \"timed_out\": false,\r\n   \"_shards\": {\r\n      \"total\": 5,\r\n      \"successful\": 5,\r\n      \"failed\": 0\r\n   },\r\n   \"hits\": {\r\n      \"total\": 1115857,\r\n      \"max_score\": 0,\r\n      \"hits\": []\r\n   }\r\n}\r\n```\r\n\r\n"}}