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

It should be easy to make use of TermState; rewritten queries should be shared automatically

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Invalid
    • None
    • None
    • core/query/scoring
    • None
    • New

    Description

      When you have the same query in a query hierarchy multiple times, tremendous savings can now be had if the user knows enough to share the rewritten queries in the hierarchy, due to the TermState addition. But this is clumsy and requires a lot of coding by the user to take advantage of. Lucene should be smart enough to share the rewritten queries automatically.

      This can be most readily (and powerfully) done by introducing a new method to Query.java:

      Query rewriteUsingCache(IndexReader indexReader)

      ... and including a caching implementation right in Query.java which would then work for all. Of course, all callers would want to use this new method rather than the current rewrite().

      Attachments

        1. lucene-2868.patch
          78 kB
          Karl Wright
        2. lucene-2868.patch
          64 kB
          Karl Wright
        3. LUCENE-2868.patch
          35 kB
          Karl Wright
        4. LUCENE-2868.patch
          37 kB
          Karl Wright
        5. LUCENE-2868.patch
          35 kB
          Karl Wright
        6. query-rewriter.patch
          37 kB
          Simon Willnauer

        Activity

          People

            simonw Simon Willnauer
            kwright@metacarta.com Karl Wright
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: