FAQ
I've managed to build my own Similarity class, plug it in, and use
Explain to convince myself that I am, indeed, getting the correct
weightings that I desire. My test case documents are yielding
precisely the intermediate values needed for alternate scoring.

There's just one thing...

When I do an .explain(), I'm getting values back for the fieldNorm()
that are improperly biasing my scores.

According to http://www.mail-archive.com/lucene-user@jakarta.apache.org/msg06275.html,
this value is actually computed at index time.

Indeed, that is the case, for if I generate a new index using my
custom Similarity class, the bias disappears and all is right with the
world.

However, I'm not exactly thrilled at the prospect of maintaining a
second index. Recall from the initial message that users will be
toggling between the standard scoring and the alternative.

And while, yes, I know that this value is precomputed and stored in
the index, what I'd like to be able to do is simply ignore it.

Somewhere the code that computes that big huge scoring equation has to
pull that value and use it. I figure if I override -that-, I can
simply ignore the value and treat fieldNorm() as 1 when the custom
version is used.

Only problem is, I'm not sure if this is a property set somewhere, a
method override in a replacement class, or some more brain surgery on
my one-off version of Lucene.

Gurus, may I approach?

-wls

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

Search Discussions

  • Doron Cohen at Jun 1, 2007 at 10:43 pm
    Hi Walt,

    AFAIK there is no flag guiding scorers to "ignore norms".
    I guess you could hack a "all norms are 1" behavior by
    writing something similar to OneNormsReader in
    org.apache.lucene.demo.SearchFiles.

    Doron

    Walt Stoneburner wrote on 01/06/2007 13:45:26:
    I've managed to build my own Similarity class, plug it in, and use
    Explain to convince myself that I am, indeed, getting the correct
    weightings that I desire. My test case documents are yielding
    precisely the intermediate values needed for alternate scoring.

    There's just one thing...

    When I do an .explain(), I'm getting values back for the fieldNorm()
    that are improperly biasing my scores.

    According to http://www.mail-archive.com/lucene-user@jakarta.
    apache.org/msg06275.html,
    this value is actually computed at index time.

    Indeed, that is the case, for if I generate a new index using my
    custom Similarity class, the bias disappears and all is right with the
    world.

    However, I'm not exactly thrilled at the prospect of maintaining a
    second index. Recall from the initial message that users will be
    toggling between the standard scoring and the alternative.

    And while, yes, I know that this value is precomputed and stored in
    the index, what I'd like to be able to do is simply ignore it.

    Somewhere the code that computes that big huge scoring equation has to
    pull that value and use it. I figure if I override -that-, I can
    simply ignore the value and treat fieldNorm() as 1 when the custom
    version is used.

    Only problem is, I'm not sure if this is a property set somewhere, a
    method override in a replacement class, or some more brain surgery on
    my one-off version of Lucene.

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • Chris Hostetter at Jun 3, 2007 at 10:37 pm
    : I guess you could hack a "all norms are 1" behavior by
    : writing something similar to OneNormsReader in
    : org.apache.lucene.demo.SearchFiles.

    Wow ... that's quite the little hidden gem in the Demo.

    The gist of the impl is pretty much exactly what you need, but
    SegmentReader has a static utility to make things easy...

    public class FlatNormsIndexReader extends FilterIndexReader {
    public FlatNormsIndexReader(IndexReder r) { super(r); }
    public byte[] norms(String field) {
    return SegmentReader.createFakeNorms(maxDoc());
    }
    }



    -Hoss


    ---------------------------------------------------------------------
    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 1, '07 at 8:45p
activeJun 3, '07 at 10:37p
posts3
users3
websitelucene.apache.org

People

Translate

site design / logo © 2022 Grokbase