lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitry Serebrennikov <>
Subject Question: using boost for sorting
Date Tue, 15 Oct 2002 02:18:26 GMT
Greetings Everyone,

I'm thinking of trying to build something that manipulates a query score 
in order to achieve a sort order other then the default relevance sort. 
The idea is to create a new type of query:
SortingQuery( Query query, String sortByField )

It would run the sub-query and return results in an order of the values 
found in the "sortByField" for those documents. Now, I've looked at all 
of the sorting discussion prior to this, and the best approach 
(recommended by Doug among others) is to provide some sort of a fast 
access to the field values inside the HitCollector. Reading documents at 
search time is too slow, so people access the data elsewhere or build an 
in-memory index of that data (such as is done in the SearchBean's 

My idea is different. I want to try to do the following:
- compose a query that consists of the original sub-query followed by a 
special "sorting query"
- "boost" the score of the original sub-query to 0
- compute the score of the sorting query such that it would reflect the 
desired sort order

Has anyone tried to do something like this?
Would this work?
Is this worth doing?
If it would, would then I have to do something during the indexing time 
to set normalization / scoring factors for that field to something or 


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message