lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Fraschetti <frasche...@gmail.com>
Subject Re: sorting and score ordering
Date Wed, 13 Oct 2004 21:40:23 GMT
If i do the following...

SortField score_sort = ScoreField.FIELD_SCORE;
Sort sort = new Sort(score_sort);
hits = searcher.search(query, sort);

I get the results orderd by the lucene score.

also, if i do...

SortField rank_sort = new SortField(RANK_FIELD, true);
Sort sort = new Sort(rank_sort);
hits = searcher.search(query, sort);

I get the results sorted by my custom ranking which is an integer
(obviously in string format)...

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.

-Chris



On Wed, 13 Oct 2004 11:53:06 -0700, Doug Cutting <cutting@apache.org> wrote:
> Paul Elschot wrote:
> >>Along with that, is there a simple way to assign a new scorer to the
> >>searcher? So I can use the same lucene algorithm for my hits, but
> >>tweak it a little to fit my needs?
> >
> >
> > There is no one to one relationship between a seacher and a scorer.
> 
> But you can use a different Similarity implementation with each Searcher.
> 
> Doug
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> 
> 


-- 
___________________________________________________
Chris Fraschetti, Student CompSci System Admin
University of San Francisco
e fraschetti@gmail.com | http://meteora.cs.usfca.edu

---------------------------------------------------------------------
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