Lucene - Core
  1. Lucene - Core
  2. LUCENE-3534

Backport FilteredQuery/IndexSearcher changes to 3.x: Remove filter logic from IndexSearcher and delegate to FilteredQuery

    Details

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

      Description

      Spinoff from LUCENE-1536: We simplified the code in IndexSearcher to no longer do the filtering there, instead wrap all Query with FilteredQuery, if a non-null filter is given. The conjunction code would then only exist in FilteredQuery which makes it easier to maintain. Currently both implementations differ in 3.x, in trunk we used the more optimized IndexSearcher variant with addition of a simplified in-order conjunction code.

      This issue will backport those changes (without random access bits).

      1. LUCENE-3463.patch
        13 kB
        Uwe Schindler
      2. LUCENE-3534.patch
        14 kB
        Uwe Schindler

        Activity

        Hide
        Uwe Schindler added a comment -

        I will start merging IndexSearcher and FilteredQuery changes to 3.x soon.

        Show
        Uwe Schindler added a comment - I will start merging IndexSearcher and FilteredQuery changes to 3.x soon.
        Hide
        Uwe Schindler added a comment -

        My problem is that this backport is almost impossible: Searchable and Searcher abstract class prevent this from being done.

        We have several choices:

        • we can heavily break backwards and maybe nuke Searcher and Searchable earlier
        • we keep API intact, only call FilteredQuery.weight() from inside IndexSaercher instead of duplicating code
        • close issue as won't fix

        Any comments?

        Show
        Uwe Schindler added a comment - My problem is that this backport is almost impossible: Searchable and Searcher abstract class prevent this from being done. We have several choices: we can heavily break backwards and maybe nuke Searcher and Searchable earlier we keep API intact, only call FilteredQuery.weight() from inside IndexSaercher instead of duplicating code close issue as won't fix Any comments?
        Hide
        Robert Muir added a comment -

        i dont think we should heavy-break in a minor release, especially since we cannot use random access Bits.

        Show
        Robert Muir added a comment - i dont think we should heavy-break in a minor release, especially since we cannot use random access Bits.
        Hide
        Uwe Schindler added a comment -

        I tend to the second solution, as the whole issue was about removing the code duplication between IS and FQ (which also have different implementations of the same code).

        Show
        Uwe Schindler added a comment - I tend to the second solution, as the whole issue was about removing the code duplication between IS and FQ (which also have different implementations of the same code).
        Hide
        Robert Muir added a comment -

        for the second solution, we get some benefits of cleanup, without breaks right? Sounds good to me.

        Show
        Robert Muir added a comment - for the second solution, we get some benefits of cleanup, without breaks right? Sounds good to me.
        Hide
        Uwe Schindler added a comment -

        Here the easy implementation, that simply removes code duplication and uses the same scorer for both implementations (IS and FQ).

        This patch uses a hack, to provide access to the wrapped scorer from inside IndexSearcher.

        This is all with no public API change at all.

        Show
        Uwe Schindler added a comment - Here the easy implementation, that simply removes code duplication and uses the same scorer for both implementations (IS and FQ). This patch uses a hack, to provide access to the wrapped scorer from inside IndexSearcher. This is all with no public API change at all.
        Hide
        Uwe Schindler added a comment -

        Small optimization, as in 3.x we dont need to move the filter to first doc, so the scorer has one less if-check.

        Also the previous patch was missing the deprecated similarity pass-through to Scorer.

        I think thats ready to commit, any comments?

        Show
        Uwe Schindler added a comment - Small optimization, as in 3.x we dont need to move the filter to first doc, so the scorer has one less if-check. Also the previous patch was missing the deprecated similarity pass-through to Scorer. I think thats ready to commit, any comments?
        Hide
        Robert Muir added a comment - - edited

        +1, i prefer the hackedy-häck-hack over duplicated code

        Show
        Robert Muir added a comment - - edited +1, i prefer the hackedy-häck-hack over duplicated code
        Hide
        Uwe Schindler added a comment -

        hey, there was an umlaut!

        Show
        Uwe Schindler added a comment - hey, there was an umlaut!
        Hide
        Uwe Schindler added a comment -

        Robert Muir added a comment - 25/Oct/11 16:51 - edited

        Much better! I will commit soon and move forward to nuking SpanFilters

        Show
        Uwe Schindler added a comment - Robert Muir added a comment - 25/Oct/11 16:51 - edited Much better! I will commit soon and move forward to nuking SpanFilters
        Hide
        Uwe Schindler added a comment -

        Committed 3.x revision: 1188805

        Show
        Uwe Schindler added a comment - Committed 3.x revision: 1188805
        Hide
        Uwe Schindler added a comment -

        Bulk close after release of 3.5

        Show
        Uwe Schindler added a comment - Bulk close after release of 3.5

          People

          • Assignee:
            Uwe Schindler
            Reporter:
            Uwe Schindler
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development