Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-451

BooleanQuery explain with boost==0

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • None
    • core/search
    • None

    Description

      BooleanWeight.explain() uses the returned score of subweights to determine if a clause matched.
      If any required clause has boost==0, the returned score will be zero and the explain for the entire BooleanWeight will be simply Explanation(0.0f, "match required").

      I'm not sure what the correct fix is here. I don't think it can be done based on score alone, since that isn't how scorers work. Perhaps we need a new method "boolean Explain.matched()" that returns true on a match, regardless of what the score may be?

      Related to the problem above, even if no boosts are zero, it it sometimes nice to know why a particular query failed to match. It would mean a longer explanation, but maybe we should include non matching explains too?

      Attachments

        1. bq.containing.clause.with.zero.boost.tests.patch
          11 kB
          Chris M. Hostetter
        2. bq.containing.clause.with.zero.boost.tests.patch
          11 kB
          Chris M. Hostetter
        3. bq.containing.clause.with.zero.boost.tests.patch
          5 kB
          Chris M. Hostetter

        Issue Links

          Activity

            People

              hossman Chris M. Hostetter
              yseeley@gmail.com Yonik Seeley
              Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: