Reputation: 203
I have created a lucene index .
I would like to get all documents that just according to a field sorting and no search terms!
Upvotes: 20
Views: 28857
Reputation: 2745
The class MatchAllDocsQuery
looks like what you need to retrieve all documents: https://lucene.apache.org/core/4_4_0/core/org/apache/lucene/search/MatchAllDocsQuery.html
Upvotes: 13
Reputation: 4289
I don't know your Lucene versions match but the answer at 1 may work for you. See 2 for another thread including another approach.
Is it possible to iterate through documents stored in Lucene Index?
http://lucene.472066.n3.nabble.com/Iterating-over-all-documents-in-an-index-td2480114.html
Upvotes: 4