Best way to retrieve certain field of all documents returned by a lucen search
Posted
by Philipp
on Stack Overflow
See other posts from Stack Overflow
or by Philipp
Published on 2010-03-24T22:24:56Z
Indexed on
2010/03/25
5:33 UTC
Read the original article
Hit count: 476
Hi,
I was wondering what the best way is to retrieve a certain field of all documents returned by a Searcher of Lucene.
Background: each document has a date field (written on) and I would like to show a timeline of all found documents, so I need to extract the date (day) field of all the documents I find with the search.
I currently retrieve every document using Searcher.doc(int, FieldSelector) having the selector only retrieve the certain field.
I have indexed 250k documents, the search itself takes no time and returns about 10k document ids.
Retrieving those however, takes 20+ seconds.
What can I do to speed things up, but still get all the values I need.
Thx in advance Philipp
© Stack Overflow or respective owner