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

Add a method to Weight to retrieve matches for a single document

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 7.4
    • None
    • None
    • New

    Description

      The ability to find out exactly what a query has matched on is a fairly frequent feature request, and would also make highlighters much easier to implement.  There have been a few attempts at doing this, including adding positions to Scorers, or re-writing queries as Spans, but these all either compromise general performance or involve up-front knowledge of all queries.

      Instead, I propose adding a method to Weight that exposes an iterator over matches in a particular document and field.  It should be used in a similar manner to explain() - ie, just for TopDocs, not as part of the scoring loop, which relieves some of the pressure on performance.

      Attachments

        1. LUCENE-8229_small_improvements.patch
          4 kB
          David Smiley
        2. LUCENE-8229.patch
          122 kB
          Alan Woodward

        Issue Links

          Activity

            People

              romseygeek Alan Woodward
              romseygeek Alan Woodward
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 5h 40m
                  5h 40m