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

Add an optional reason to the MatchNoDocsQuery

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 6.2, 7.0
    • core/search
    • New, Patch Available

    Description

      It's sometimes difficult to debug a query that results in a MatchNoDocsQuery. The MatchNoDocsQuery is always rewritten in an empty boolean query.
      This patch adds an optional reason and implements a weight in order to keep track of the reason why the query did not match any document. The reason is printed on toString and when an explanation for noMatch is asked.
      For instance the query:
      new MatchNoDocsQuery("Field not found").toString()
      => 'MatchNoDocsQuery["field 'title' not found"]'

      Attachments

        1. LUCENE-7276.patch
          6 kB
          Jim Ferenczi
        2. LUCENE-7276.patch
          8 kB
          Michael McCandless
        3. LUCENE-7276.patch
          8 kB
          Michael McCandless
        4. LUCENE-7276.patch
          26 kB
          Michael McCandless
        5. LUCENE-7276.patch
          13 kB
          Michael McCandless
        6. LUCENE-7276.patch
          24 kB
          Michael McCandless

        Activity

          People

            Unassigned Unassigned
            jim.ferenczi Jim Ferenczi
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: