lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gurukeerthi Gurunathan" <>
Subject Sorting based on calculations at search time
Date Fri, 10 Dec 2004 20:55:04 GMT
 I'd like some suggestions on the following scenario. 
 Say I have an index with a stored, indexed field called
'weight'(essentially an int stored as string). I'd like to sort in
descending order of final weight, the search results by performing a
calculation involving the lucene score for each hits. For our
discussion, the calculation can be as simple as multiplying the lucene
score with the value from the field 'weight' to get final weight. The
search results can run into thousands of documents. Though finally I may
need only the top X number of documents, I wouldn't know what the top X
would be until I perform this calculation and sort it.
 The obvious way is to do a post processing of the hits iterator,
storing it in memory, performing this calculation and sorting it. Is
there any other better solution for this?
Gurukeerthi Gurunathan
Third Pillar Systems
San Mateo, CA

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message