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

TermsQuery should rewrite to a ConstantScoreQuery over a BooleanQuery when there are few terms

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.2, 6.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      TermsQuery helps when there are lot of terms from which you would like to compute the union, but it is a bit harmful when you have few terms since it cannot really skip: it always consumes all documents matching the underlying terms.

      It would certainly help to rewrite this query to a ConstantScoreQuery over a BooleanQuery when there are few terms in order to have actual skip support.

      As usual the hard part is probably to figure out the threshold.

        Attachments

        1. LUCENE-6360.patch
          14 kB
          Adrien Grand
        2. LUCENE-6360.patch
          19 kB
          Adrien Grand
        3. LUCENE-6360.patch
          21 kB
          Adrien Grand

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: