Lucene - Core
  1. Lucene - Core
  2. LUCENE-6640

Remove dependency of lucene/suggest on oal.search.Filter

    Details

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

      Description

      oal.search.Filter is on the way out, yet the suggest module is still using it in order to filter suggestions and it can't be replaced with queries given that true (out-of-order) random access is required.

      1. LUCENE-6640.patch
        23 kB
        Adrien Grand
      2. LUCENE-6640.patch
        24 kB
        Adrien Grand

        Activity

        Hide
        Adrien Grand added a comment -

        Here is a proposal: add a new API called BitsProducer with the following definition:

        /** A producer of {@link Bits} per segment. */
        public abstract class BitsProducer {
        
          /** Return {@link Bits} for the given leaf. The returned instance must
           *  be non-null and have a {@link Bits#length() length} equal to
           *  {@link LeafReader#maxDoc() maxDoc}. */
          public abstract Bits getBits(LeafReaderContext context) throws IOException;
        
        }
        

        And use it in lieu of Filter. Tests pass and I think it has the benefit of making the API a bit less trappy in the sense that it's now obvious that random-access is required?

        Show
        Adrien Grand added a comment - Here is a proposal: add a new API called BitsProducer with the following definition: /** A producer of {@link Bits} per segment. */ public abstract class BitsProducer { /** Return {@link Bits} for the given leaf. The returned instance must * be non- null and have a {@link Bits#length() length} equal to * {@link LeafReader#maxDoc() maxDoc}. */ public abstract Bits getBits(LeafReaderContext context) throws IOException; } And use it in lieu of Filter. Tests pass and I think it has the benefit of making the API a bit less trappy in the sense that it's now obvious that random-access is required?
        Hide
        Michael McCandless added a comment -

        +1, thanks Adrien Grand

        Couldn't we make a simple BitsProducer that accepts no docs, and preserve testSuggestOnAllFilteredDocuments?

        Show
        Michael McCandless added a comment - +1, thanks Adrien Grand Couldn't we make a simple BitsProducer that accepts no docs, and preserve testSuggestOnAllFilteredDocuments?
        Hide
        Adrien Grand added a comment -

        Here is an updated patch. I added special casing for Bits.MatchNoBits in CompletionWeight in order to restore this circuit break when the filter does not match anything.

        Show
        Adrien Grand added a comment - Here is an updated patch. I added special casing for Bits.MatchNoBits in CompletionWeight in order to restore this circuit break when the filter does not match anything.
        Hide
        Michael McCandless added a comment -

        +1 thanks Adrien Grand!

        Show
        Michael McCandless added a comment - +1 thanks Adrien Grand !
        Hide
        ASF subversion and git services added a comment -

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

        LUCENE-6640: Use BitsProducer instead of Filter in lucene/suggest.

        Show
        ASF subversion and git services added a comment - Commit 1688682 from Adrien Grand in branch 'dev/trunk' [ https://svn.apache.org/r1688682 ] LUCENE-6640 : Use BitsProducer instead of Filter in lucene/suggest.
        Hide
        ASF subversion and git services added a comment -

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

        LUCENE-6640: Use BitsProducer instead of Filter in lucene/suggest.

        Show
        ASF subversion and git services added a comment - Commit 1688683 from Adrien Grand in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1688683 ] LUCENE-6640 : Use BitsProducer instead of Filter in lucene/suggest.
        Hide
        Adrien Grand added a comment -

        Thanks Mike!

        Show
        Adrien Grand added a comment - Thanks Mike!
        Hide
        ASF subversion and git services added a comment -

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

        LUCENE-6640: Add missing javadocs.

        Show
        ASF subversion and git services added a comment - Commit 1688723 from Adrien Grand in branch 'dev/trunk' [ https://svn.apache.org/r1688723 ] LUCENE-6640 : Add missing javadocs.
        Hide
        ASF subversion and git services added a comment -

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

        LUCENE-6640: Add missing javadocs.

        Show
        ASF subversion and git services added a comment - Commit 1688724 from Adrien Grand in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1688724 ] LUCENE-6640 : Add missing javadocs.
        Hide
        Shalin Shekhar Mangar added a comment -

        Bulk close for 5.3.0 release

        Show
        Shalin Shekhar Mangar added a comment - Bulk close for 5.3.0 release

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development