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 <[email protected]> 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 index.
> 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
>
>

Reply via email to