Lucene - Core
  1. Lucene - Core
  2. LUCENE-4925

IndexSearcher.search is broken when IndexSearcher.executor != null and the sort contains SortField.FIELD_SCORE

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.2.1
    • Fix Version/s: 4.3
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      When executor != null, IndexSearcher performs two passes to compute the top docs. This doesn't work when the sort contains SortField.FIELD_SCORE because the second pass doesn't have access to scores computed in the first pass. Since search(...) doesn't compute scores when there is a sort, they are all Float.NaN.

        Activity

        Hide
        Adrien Grand added a comment -

        Patch. Without the patch applied, the new test in TestSort would fail whenever LuceneTestCase.newSearcher would return a Searcher that collects segments in parallel.

        Show
        Adrien Grand added a comment - Patch. Without the patch applied, the new test in TestSort would fail whenever LuceneTestCase.newSearcher would return a Searcher that collects segments in parallel.
        Hide
        Michael McCandless added a comment -

        Good catch! +1

        Show
        Michael McCandless added a comment - Good catch! +1
        Hide
        Robert Muir added a comment -

        +1, thank you Adrien!

        Show
        Robert Muir added a comment - +1, thank you Adrien!
        Hide
        Commit Tag Bot added a comment -

        [trunk commit] jpountz
        http://svn.apache.org/viewvc?view=revision&revision=1466694

        LUCENE-4925: Fix IndexSearcher.search(..., Sort, ...).

        Show
        Commit Tag Bot added a comment - [trunk commit] jpountz http://svn.apache.org/viewvc?view=revision&revision=1466694 LUCENE-4925 : Fix IndexSearcher.search(..., Sort, ...).
        Hide
        Commit Tag Bot added a comment -

        [branch_4x commit] jpountz
        http://svn.apache.org/viewvc?view=revision&revision=1466696

        LUCENE-4925: Fix IndexSearcher.search(..., Sort, ...) (merged from r1466694).

        Show
        Commit Tag Bot added a comment - [branch_4x commit] jpountz http://svn.apache.org/viewvc?view=revision&revision=1466696 LUCENE-4925 : Fix IndexSearcher.search(..., Sort, ...) (merged from r1466694).
        Hide
        Uwe Schindler added a comment -

        Closed after release.

        Show
        Uwe Schindler added a comment - Closed after release.

          People

          • Assignee:
            Adrien Grand
            Reporter:
            Adrien Grand
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development