lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jenny Brown <>
Subject Re: Get all document ids from a search.
Date Mon, 14 Dec 2009 23:08:16 GMT
Store the document id as an extra field in your lucene index, and
retrieve it when you get your relevance hits.  Then take the same id
list and go query your database however you need to.  Searching takes
two passes, but then you get the benefit of both lucene and database.

On Mon, Dec 14, 2009 at 5:00 PM, Niclas Rothman <> wrote:
> Hi there,
> Perhaps this is far out but I need to get some advice on the following problem.
> We use Lucene what it is really good to, to find documents by "relevance".
> After a search have been done and I have the hits in my hands, I need to do some heavy
sorting on this list where the data about sorting is stored in the database, not in the lucene
> Therefore I need to get all document ids for a search so I can fetch the needed data
from the database and afterwards apply my custom sorting.
> How can I get from a search all document ids?
> Can this be done with ok performance?
> I have been wondering if could do the sorting in lucene but I don't feel comfortable
at all because of lacking information / documentation.
> Also, the sorting should preferable be don Just in time, that is, the underlying data
for sorting changes constantly and I cant reindex as soon as sorting data changes.
> Any idea / suggestions?
> Niclas

View raw message