lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "prabin meitei" <prabin.mei...@gmail.com>
Subject Re: Dynamic Score Boosting by creator
Date Thu, 11 Dec 2008 17:27:14 GMT
Hi,   You can boost an individual query.
For example
Assuming your query to be a boolean query containing a term for the creator
BooleanQuery query = new BooleanQuery();
.
(any other part of your query)
.

TermQuery termQ = new TermQuery(new Term("creator", user));
termQ.setBoost(3.0f);  //boost this query by factor of 3

query.add(termQ, Occur.SHOULD);

This will make sure that any document matching creator with user will be
given more boost.


Prabin Meitei
toostep.com



On Thu, Dec 11, 2008 at 8:52 PM, Dalvi, Rajesh <rdalvi@ptc.com> wrote:

> Hello,
>
> I am indexing creator information for each document. When I query with
> given User, I want documents created by the given user should score
> higher. How can I do this?
>
> Thanks,
> Rajesh
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message