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

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 5.2, 6.0
    • None
    • None
    • 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
          21 kB
          Adrien Grand
        2. LUCENE-6360.patch
          19 kB
          Adrien Grand
        3. LUCENE-6360.patch
          14 kB
          Adrien Grand

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: