FAQ
I have a minimal unit test in which I add three documents to an index. The documents have two fields "year" and "descritpion".
doc1(year = "2007", desc = "text with 2007 and 2009")
doc2(year = "2009", desc = "text with 2007 and 2009")
doc3(year = "2008", desc = "text with 2007 and 2009")

To search I use a BooleanQuery with a TermQuery (very high boosted), a PrefixQuery (high boosted) and a WildcardQuery (normal boost).

when I search for "2007" I get
doc1
doc2
doc3

when I search for "2009" I get
doc2
doc1
doc3

Looks like the "exact match" on year is rated higher, which is good. Now when I set the boost factor of year to 2f I get the same results. But when I set the boost factor of year to 10f the order is inversed, i.e. the matching on desc is rated higher.

How come?


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org

Search Discussions

  • Erick Erickson at Jun 2, 2011 at 11:00 pm
    Have you tried using the explain method on a Searcher and examining the results?

    Best
    Erick
    On Thu, Jun 2, 2011 at 3:51 PM, Clemens Wyss wrote:
    I have a minimal unit test in which I add three documents to an index. The documents have two fields "year" and "descritpion".
    doc1(year = "2007", desc = "text with 2007 and 2009")
    doc2(year = "2009", desc = "text with 2007 and 2009")
    doc3(year = "2008", desc = "text with 2007 and 2009")

    To search I use a BooleanQuery with a TermQuery (very high boosted), a PrefixQuery (high boosted) and a WildcardQuery (normal boost).

    when I search for "2007" I get
    doc1
    doc2
    doc3

    when I search for "2009" I get
    doc2
    doc1
    doc3

    Looks like the "exact match" on year is rated higher, which is good. Now when I set the boost factor of year to 2f I get the same results. But when I set the boost factor of year to 10f the order is inversed, i.e. the matching on desc is rated higher.

    How come?


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedJun 2, '11 at 7:51p
activeJun 2, '11 at 11:00p
posts2
users2
websitelucene.apache.org

2 users in discussion

Clemens Wyss: 1 post Erick Erickson: 1 post

People

Translate

site design / logo © 2022 Grokbase