lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominik Bruhn <domi...@dbruhn.de>
Subject Sorting & SQL-Database
Date Fri, 30 Jun 2006 23:10:50 GMT
Hy,
i use Lucene to index a SQL-Table which contains three fields: a index-field, 
the text to search in and another field. When adding a lucene document I let 
Lucene index the search-field and also save the id along with it in the 
lucene index.

Uppon searching I collect all ids and add them to a java-string with commas in 
between to issue a SQL-Query like this one:

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?


Thanks
-- 
Dominik Bruhn
mailto: dominik@dbruhn.de
http://www.dbruhn.de

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message