FAQ
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

Search Discussions

  • Prabin meitei at Dec 11, 2008 at 5:31 pm
    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 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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedDec 11, '08 at 3:23p
activeDec 11, '08 at 5:31p
posts2
users2
websitelucene.apache.org

2 users in discussion

Prabin meitei: 1 post Dalvi, Rajesh: 1 post

People

Translate

site design / logo © 2022 Grokbase