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

TopDocsCollector should have bounded generic <T extends ScoreDoc>

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.0
    • core/search
    • None
    • New

    Description

      TopDocsCollector was changed to be TopDocsCollector<T>. However it has methods which specifically assume the PQ stores ScoreDoc. Therefore, if someone extends it and defines a type which is not ScoreDoc, things will break.

      We shouldn't put <T> on TopDocsCollector at all, but rather change its ctor to protected TopDocsCollector(PriorityQueue<? extends ScoreDoc> pq). TopDocsCollector should handle ScoreDoc types. If we do this, we'll need to change FieldValueHitQueue's Entry to extend ScoreDoc as well.

      Attachments

        1. scoredoc.patch
          6 kB
          Uwe Schindler

        Activity

          People

            uschindler Uwe Schindler
            shaie Shai Erera
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: