Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-3643

Improve FilteredQuery to shortcut on wrapped MatchAllDocsQuery

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.0-ALPHA
    • Fix Version/s: 4.0-ALPHA
    • Component/s: core/search
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      Since the rewrite of Lucene trunk to delegate all Filter logic to FilteredQuery, by simply wrapping in IndexSearcher.wrapFilter(), we can do more short circuits and improve query execution. A common use case it to pass MatchAllDocsQuery as query to IndexSearcher and a filter. For the underlying hit collection this is stupid and slow, as MatchAllDocsQuery simply increments the docID and checks acceptDocs. If the filter is sparse, this is a big waste. This patch changes FilteredQuery.rewrite() to short circuit and return ConstantScoreQuery, if the query is MatchAllDocs.

        Attachments

        1. LUCENE-3643-noNullQueryFilter.patch
          11 kB
          Uwe Schindler
        2. LUCENE-3643-allowNullQueryFilter.patch
          17 kB
          Uwe Schindler
        3. LUCENE-3643.patch
          0.0 kB
          Uwe Schindler
        4. LUCENE-3643.patch
          17 kB
          Uwe Schindler
        5. LUCENE-3643.patch
          17 kB
          Uwe Schindler
        6. LUCENE-3643.patch
          14 kB
          Uwe Schindler

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: