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

Allow driving a query by sparse filters

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • core/search
    • None
    • New

    Description

      Today if a filter is very sparse we execute the query in sort of a leap-frog manner between the query and filter. If the query is very expensive to compute, and/or matching few docs only too, calling scorer.advance(doc) just to discover the doc it landed on isn't accepted by the filter, is a waste of time. Since Filter is always the "final ruler", I wonder if we had something like boolean DISI.advanceExact(doc) we could use it instead, in some cases.

      There are many combinations in which I think we'd want to use/not-use this API, and they depend on: Filter's complexity, Filter.cost(), Scorer.cost(), query complexity (span-near, many clauses) etc.

      I open an issue so we can discuss. DISI.advanceExact(doc) is just a preliminary proposal, to get an API we could experiment with. The default implementation should be fairly easy and straightforward, and we could override where we can offer a more optimized imp.

      Attachments

        1. TestSlowQuery.java
          15 kB
          Mikhail Khludnev

        Issue Links

          Activity

            People

              Unassigned Unassigned
              shaie Shai Erera
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: