lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: custom sort
Date Tue, 30 Aug 2005 21:20:48 GMT

: You can just assign the field B some weight when creating the index?

that implies that the field "A" being sorted on is SCORE ... which isn't
allways the case.

: Is it possible to write a custom sort for a query such that the first
: N documents that match a certain additional criteria get pushed to the
: top of the sort?  For instance say you sort your query based on field A,
: but you want to tweak the results such that the first 10 documents in
: the result set which have field B = some criteria will appear at the

absolutely, you can put juse about any code you want in a custom
SortComparatorSource to order documents using whatever rules you want.
You'll probably need to hard code your special field name "B" into the
code hosever, either that or fetch it from a global variable or a system
property.


-Hoss


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