Details

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

      Description

      IndexSearcher has lots of methods that take a filter, and merge it with the query using a FilteredQuery when it is non null. I would like to remove these methods in favour of methods that only take a query and leave the responsibility to build a FilteredQuery or a BooleanQuery with FILTER clause to the user.

      1. LUCENE-6286.patch
        289 kB
        Adrien Grand

        Activity

        Hide
        Adrien Grand added a comment -

        Here is a patch. In most cases, callers were passing a null filter, and in the other cases calling code was changed to do the wrapping in a FilteredQuery explicitely.

        Show
        Adrien Grand added a comment - Here is a patch. In most cases, callers were passing a null filter, and in the other cases calling code was changed to do the wrapping in a FilteredQuery explicitely.
        Hide
        Robert Muir added a comment -

        It is a little strange that now the regular search methods call searchAfter

        Show
        Robert Muir added a comment - It is a little strange that now the regular search methods call searchAfter
        Hide
        Adrien Grand added a comment -

        This was changed in LUCENE-6220, but it was this way on 4.x too, the names just do not make it clear. Here is an excerpt from 4.10's IndexSearcher:

          /** Finds the top <code>n</code>
           * hits for <code>query</code>, applying <code>filter</code> if non-null.
           *
           * @throws BooleanQuery.TooManyClauses If a query would exceed 
           *         {@link BooleanQuery#getMaxClauseCount()} clauses.
           */
          public TopDocs search(Query query, Filter filter, int n)
            throws IOException {
            return search(createNormalizedWeight(wrapFilter(query, filter)), null, n);
          }
        

        The object which is passed as null on the last line is the "ScoreDoc after" parameter.

        Show
        Adrien Grand added a comment - This was changed in LUCENE-6220 , but it was this way on 4.x too, the names just do not make it clear. Here is an excerpt from 4.10's IndexSearcher: /** Finds the top <code>n</code> * hits for <code>query</code>, applying <code>filter</code> if non-null. * * @throws BooleanQuery.TooManyClauses If a query would exceed * {@link BooleanQuery#getMaxClauseCount()} clauses. */ public TopDocs search(Query query, Filter filter, int n) throws IOException { return search(createNormalizedWeight(wrapFilter(query, filter)), null, n); } The object which is passed as null on the last line is the "ScoreDoc after" parameter.
        Hide
        Robert Muir added a comment -

        Does it cause ambiguity (null is used often here) if we add the new methods and deprecated the old ones in 5.1?

        Show
        Robert Muir added a comment - Does it cause ambiguity (null is used often here) if we add the new methods and deprecated the old ones in 5.1?
        Hide
        Adrien Grand added a comment -

        No, there will be no ambiguity.

        Show
        Adrien Grand added a comment - No, there will be no ambiguity.
        Hide
        Robert Muir added a comment -

        +1 to the patch and also to make the deprecated methods final.

        Show
        Robert Muir added a comment - +1 to the patch and also to make the deprecated methods final.
        Hide
        ASF subversion and git services added a comment -

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

        LUCENE-6286: Removed IndexSearcher methods that take a Filter object.

        Show
        ASF subversion and git services added a comment - Commit 1662059 from Adrien Grand in branch 'dev/trunk' [ https://svn.apache.org/r1662059 ] LUCENE-6286 : Removed IndexSearcher methods that take a Filter object.
        Hide
        ASF subversion and git services added a comment -

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

        LUCENE-6286: Removed IndexSearcher methods that take a Filter object.

        Show
        ASF subversion and git services added a comment - Commit 1662082 from Adrien Grand in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1662082 ] LUCENE-6286 : Removed IndexSearcher methods that take a Filter object.
        Hide
        Timothy Potter added a comment -

        Bulk close after 5.1 release

        Show
        Timothy Potter added a comment - Bulk close after 5.1 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