lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From laimis <>
Subject [GitHub] lucenenet pull request: calculate max boost once
Date Sun, 24 May 2015 02:57:33 GMT
GitHub user laimis opened a pull request:

    calculate max boost once

    This is a bit long, but the issue is a bit messy so putting as much info as possible.
Troubleshooting the failing tests shown here:
    There is something odd going on with float number comparison that is triggered by the
environment that the code is running. No matter how many times this is run on my machine in
release or debug builds it never fails, but fails all the time on TC. A separate branch was
created with more logging to see what the difference is between passing and failing cases
and I arrived at the change that is in this PR.
    What the diagnostic output is showing is that Bottom > CalculateMaxBoost(MaxEdits)
is evaluating to true in the failing cases when it really should be false.
    Here is the link to verbose branch so you can see what output means what:
    Here is diagnostics info when the failure occurs:
    FuzzyTermsEnum bottom changed, lastTerm=, init=True, MaxEdits=1
        termAfter=False, Bottom=0.857142866
        subtract.  <----- this should never happen
        oldMaxEdits=1, maxEdits=0
        Max distance changed
    Here is the passing output:
    FuzzyTermsEnum bottom changed, lastTerm=, init=True, MaxEdits=1
        termAfter=False, Bottom=0.857142866
        oldMaxEdits=1, maxEdits=1  <-- note maxEdits=1 and not 0
        Max distance changed
    That maxEdits value change prevents 3 docs from being scored. That changes total hits
from 5 to 2 and you can see that in the assert failure in the unit test.
    I suspect TestTopDocsMerge failures is the same issue. I am still trying to pin point
which floating comparison is changing the results there but got myself into a situation where
adding verbose output now makes it not fail in TC anymore. So I will continue to dig there.

You can merge this pull request into a Git repository by running:

    $ git pull fuzzytermsenum_fix

Alternatively you can review and apply these changes as the patch at:

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #148
commit 61afda40a7d5b720331c92a9b4defdb4125bff0d
Author: Laimonas Simutis <>
Date:   2015-05-24T02:32:48Z

    calculate max boost once


If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message