lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: sorting and score ordering
Date Thu, 14 Oct 2004 15:27:34 GMT
On Oct 13, 2004, at 5:40 PM, Chris Fraschetti wrote:
> and finally if i do....
>
> SortField score_sort = ScoreField.FIELD_SCORE;
> SortField rank_sort = new SortField(RANK_FIELD, true);
> SortField[] sort_fields = {score_sort, rank_sort};
> Sort sort = new Sort(sort_fields);
> hits = searcher.search(query, sort);
>
> I get the same results as I did with the score_sort only... no change
> in the ordering of the rank is there... any ideas? It looks to me as
> if it's completely ignoring it.

This is sorting first by score and then by your rank field.  The rank 
field sort only applies when the scores are the same.  I suspect you're 
getting different scores so you'd never see rank come into play.

Display the score and rank in your results to see for sure.

	Erik


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


Mime
View raw message