Lucene - Core
  1. Lucene - Core
  2. LUCENE-1557

Make constant-score rewrite the default for multi-term queries

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Invalid
    • Affects Version/s: 2.4.1
    • Fix Version/s: 3.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      For queries that expand to multiple terms (PrefixQuery, RangeQuery, FuzzyQuery, WildcardQuery), the default now is to rewrite to a BooleanQuery, which scales poorly, and can hit the dreaded TooManyClauses (ungraceful degradation).

      Except for FuzzyQuery (which we should fix with this issue), they all support setConstantScoreRewrite, which scales better.

      In 3.0 we should make constantScoreRewrite the default, and leave an option to turn it off.

      This is a spinoff from LUCENE-998.

        Activity

        Hide
        Uwe Schindler added a comment -

        I take this, will provide a patch soon.

        Show
        Uwe Schindler added a comment - I take this, will provide a patch soon.
        Hide
        Robert Muir added a comment -

        Uwe, I am a little confused about this issue. The MultiTermQuery now has a lot of smarts with regards to this. I feel it is obselete

        Is this kept open just for the FuzzyQuery?

        Show
        Robert Muir added a comment - Uwe, I am a little confused about this issue. The MultiTermQuery now has a lot of smarts with regards to this. I feel it is obselete Is this kept open just for the FuzzyQuery?
        Hide
        Uwe Schindler added a comment -

        It is almost obsolete. Fuzzy is fixed to boolean rewrite. The other queries have no longer any other modes. Only at some places in contrib are fixed rewrite setting, whcih I simply remove.

        Everywhere else, the defaults are already correct, RangeQuery & Co are gone (deprecated) and the new ones were already in auto mode. The patch only contains cleanup. We can close this soon.

        I want to get out 3.0.

        Show
        Uwe Schindler added a comment - It is almost obsolete. Fuzzy is fixed to boolean rewrite. The other queries have no longer any other modes. Only at some places in contrib are fixed rewrite setting, whcih I simply remove. Everywhere else, the defaults are already correct, RangeQuery & Co are gone (deprecated) and the new ones were already in auto mode. The patch only contains cleanup. We can close this soon. I want to get out 3.0.
        Hide
        Uwe Schindler added a comment -

        Thats all, will commit as soon as relevant tests were run.

        Show
        Uwe Schindler added a comment - Thats all, will commit as soon as relevant tests were run.
        Hide
        Robert Muir added a comment -

        I want to get out 3.0.

        +1

        Show
        Robert Muir added a comment - I want to get out 3.0. +1
        Hide
        Uwe Schindler added a comment -

        Sorry, the SpanRegExQuery must stay unmodified, because it relays on BooleanQuery.

        Show
        Uwe Schindler added a comment - Sorry, the SpanRegExQuery must stay unmodified, because it relays on BooleanQuery.
        Hide
        Uwe Schindler added a comment - - edited

        This issue is no longer relevant. All classes were deprecated in 2.9 and now removed and there is nothing to change anymore.

        Show
        Uwe Schindler added a comment - - edited This issue is no longer relevant. All classes were deprecated in 2.9 and now removed and there is nothing to change anymore.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development