On 6/30/06, Dominik Bruhn <[EMAIL PROTECTED]> wrote:
SELECT id,addfield FROM table WHERE id IN ([LUCENERESULT]);

Where LUCENERESULT is like 2,3,19,3,5.

This works fine but got one problem: The Search-Result of Lucene is order by
relevance and so the id-list is also sorted by relevance. But the result of
the SQL-Query is sorted by the id which destroys the relevance-sorting.

Does anybody know a work-arround?

We have the same issue and solve this through code.  As you're
generating the list of IDs for the SQL query, also generate a hash
that maps the ID to its position.  When reading back the data from the
database, read the position hash, and insert the item into the
appropriate position in an array.  Yeah, you're doing the sorting
yourself, but in our case, we're only returning 10 items per page, so
its not a huge performance hit.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to