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

Using MultiSearcher and ParallelMultiSearcher can change the sort order.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.9
    • core/search
    • None
    • Checked with revision 314961 on 2005-10-12

    Description

      When using multiple sort criteria the first criterium that indicates a difference should be used.
      When a field does not exist for a given document, special rules apply.
      From what I see in the code, it is sorted as 0 for integer and float fields, and null Strings are sorted before others.

      This works correctly in both Lucene 1.4.3 and in trunk as long as you use a single IndexSearcher (except perhaps in special cases, see other bug reports like LUCENE-374).

      However, in MultiSearcher and ParallelMultiSearcher, the results of the separate IndexSearchers are merged and there an error occurs.
      The bug is located in FieldDocSortedHitQueue.

      It can even be demonstrated by passing a single indexSearcher to a MultiSearcher.

      TestCase and patch follow.

      Attachments

        1. TestSort.diff
          4 kB
          Luc Vanlerberghe
        2. FieldDocSortedHitQueue.diff
          1 kB
          Luc Vanlerberghe

        Activity

          People

            yseeley@gmail.com Yonik Seeley
            lvl Luc Vanlerberghe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: