lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Koji Sekiguchi <k...@r.email.ne.jp>
Subject Re: Term level boosting
Date Tue, 24 Mar 2009 13:58:31 GMT
Seid Mohammed wrote:
> Hi All
> I want my lucene to index documents and making some terms to have more
> boost value.
> so, if I index the document "The quick fox jumps over the lazy dog"
> and I want the term fox and dog to have greater boost value.
> How can I do that
>
> Thanks a lot
>
> seid M
>
>   

How about using BoostingTermQuery and Payload?

1. In your Analyzer, put a value (boost value, for example) into payload 
of Token "fox" and "dog".
2. Define your Similarity and override scorePayload() method to boost 
marked token.
3. Use your Similarity when construct IndexSearcher, and use 
BoostingTermQuery when searching.

regards,

Koji


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