liip/LiipDrupalRegistryModule — pull request #26 by lapistano (2014-01-28 19:07:08+00:00)
Title: Get all documents fix

It came to my attention that it is currently not possible to get all documents of a search result or an index returned by using getContents(). This is because of the fact that ElasticSearch it self limits the result set to 10 documents.
This can only be increased by setting a new limt (»size« in ES language). Despite my thoughts setting it to 0 (zero) does not in creases the number of returned documents to all but actually make ES to return zero documents in the result set. Setting to to a big number instead, will bring the expected result.
Unfortunately the big number has to be higher than the amount of expected documents or ridiculously high to be sure to get all documents, but not too high to make ES crash with a memory limit exceeded exception ... tricky.

reference: http://stackoverflow.com/questions/8829468/elastic-search-query-to-return-all-records