Lucene - Core
  1. Lucene - Core
  2. LUCENE-6145

Make EarlyTerminatingSortingCollector smarter about when it can early terminate

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0, 6.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      Today EarlyTerminatingSortingCollector only early-terminates if the sort order matches exactly the index-time sort order. It should also early-terminate when the sort order is a prefix of the index-time sort order.

      1. LUCENE-6145.patch
        11 kB
        Adrien Grand

        Activity

        Hide
        Adrien Grand added a comment -

        Here is a patch. EarlyTerminatingSortingCollector now also takes the merge policy as an argument to check if the sort order is a prefix of the index-time order and then early-terminates on every segment where the serialized index order matches the sort order that is wrapped by the merge policy.

        Show
        Adrien Grand added a comment - Here is a patch. EarlyTerminatingSortingCollector now also takes the merge policy as an argument to check if the sort order is a prefix of the index-time order and then early-terminates on every segment where the serialized index order matches the sort order that is wrapped by the merge policy.
        Hide
        Robert Muir added a comment -

        I am +1 to the patch, but not excited about permanently requiring the user to pass a MergePolicy to this collector.

        One reason is that it makes it harder to integrate with other search code. E.G. somewhere i made a patch to allow inexact results/hit counts as flags to indexsearcher, which would make this collector much easier to use (and also allow other tricks).

        But this means somehow we have to serialize the "sort" better, which is complicated. So +1 to the patch for now

        Show
        Robert Muir added a comment - I am +1 to the patch, but not excited about permanently requiring the user to pass a MergePolicy to this collector. One reason is that it makes it harder to integrate with other search code. E.G. somewhere i made a patch to allow inexact results/hit counts as flags to indexsearcher, which would make this collector much easier to use (and also allow other tricks). But this means somehow we have to serialize the "sort" better, which is complicated. So +1 to the patch for now
        Hide
        ASF subversion and git services added a comment -

        Commit 1648547 from Adrien Grand in branch 'dev/trunk'
        [ https://svn.apache.org/r1648547 ]

        LUCENE-6145: Make EarlyTerminatingSortingCollector able to early-terminate when the sort order is a prefix of the index-time order.

        Show
        ASF subversion and git services added a comment - Commit 1648547 from Adrien Grand in branch 'dev/trunk' [ https://svn.apache.org/r1648547 ] LUCENE-6145 : Make EarlyTerminatingSortingCollector able to early-terminate when the sort order is a prefix of the index-time order.
        Hide
        ASF subversion and git services added a comment -

        Commit 1648555 from Adrien Grand in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1648555 ]

        LUCENE-6145: Make EarlyTerminatingSortingCollector able to early-terminate when the sort order is a prefix of the index-time order.

        Show
        ASF subversion and git services added a comment - Commit 1648555 from Adrien Grand in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1648555 ] LUCENE-6145 : Make EarlyTerminatingSortingCollector able to early-terminate when the sort order is a prefix of the index-time order.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development