lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tatu Saloranta <>
Subject Re: Weighted Search by Field using MultiFieldQueryParser
Date Tue, 17 Jun 2003 14:13:54 GMT
On Tuesday 17 June 2003 05:43, Kevin L. Cobb wrote:
> I have an index that has three fields in it. When I do a search using
> MultiFieldQueryParser, the search applies the same importance (weight)
> to each of the fields. BUT, what if I want to apply a different weight
> to each field, i.e. I want to consider found terms from certain fields
> as less "important" than others. I have applied an algorithm to help me
> do this, which involves searching each field separately and then
> recombining the results into a single collection, but hate to reinvent
> the wheel if I don't have to.

Have you looked at MultiFieldQueryParser source? It's a very simple class, and
modifying it (making a new class) should be easy; pass in not only field names 
but also weights to apply?
(as a sidenote, MultiFieldQueryParser does some unnecessary work as is... it 
seems to re-parse same query once for each field, could just clone it)

-+ Tatu +-

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

View raw message