Hi,
Just wondering how I can rank search result by a combination of fields. I
know there is a multi-field sort, but it is just a sorting method. It is
sorted by the first field and then the second field ... 
What I need is a weighted combination. For example, I want to assign a
weight of 2 to title match, 1.5 to abstract match, and 3 to date match (i.e.
How close the last modified date). The final score will be
2*inTitle+1.5*inAbstract+3*date instead of sorting by date and then sorting
by title within the same date. 
I checked lucene Score, Similarity, and SortDocComparator and can't find an
answer. Implements the SortDocComparator seems the closest, but it can only
sort the result by one field. The Field boost does not work because the
boosting factor has to be set during index time. What I need is setting the
weight at query time.
Please help. Thanks.

Yang


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to