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

Only assign ScoreDoc#shardIndex if it was already assigned to non default (-1) value

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.5, 7.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      When you use TopDocs.merge today it always overrides the ScoreDoc#shardIndex value. The assumption that is made here is that all shard results are merges at once which is not necessarily the case. If for instance incremental merge phases are applied the shard index doesn't correspond to the index in the outer TopDocs array. To make this a backwards compatible but yet non-controversial change we could change the internals of TopDocs#merge to only assign this value unless it's not been assigned before to a non-default (-1) value to allow multiple or sparse top docs merging.

        Attachments

        1. LUCENE-7707.patch
          15 kB
          Michael McCandless
        2. LUCENE-7707.patch
          13 kB
          Michael McCandless
        3. LUCENE-7707.patch
          13 kB
          Simon Willnauer
        4. LUCENE-7707.patch
          13 kB
          Simon Willnauer
        5. LUCENE-7707.patch
          10 kB
          Simon Willnauer
        6. LUCENE-7707.patch
          10 kB
          Simon Willnauer
        7. LUCENE-7707.patch
          8 kB
          Simon Willnauer
        8. LUCENE-7707.patch
          4 kB
          Simon Willnauer

          Activity

            People

            • Assignee:
              simonw Simon Willnauer
              Reporter:
              simonw Simon Willnauer
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: