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

Improve Query rewriting for non-scoring clauses

Details

    • Task
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 9.2
    • None
    • None
    • New

    Description

      Query rewriting is occasionally important for performance, e.g. it may allow using an optimized bulk scorer instead of the default bulk scorer like in the example from LUCENE-10412.

      One case when we could simplify queries is in the non-scoring case. All layers of query wrappers that only affect scoring like BoostQuery and ConstantScore query can be removed, which might help identify new opportunities for rewriting. For instance, we have several rewrite rules that optimize for MatchAllDocsQuery and would fail to recognize it if it is behind a ConstantScoreQuery or a BoostQuery. Boolean queries can also simplify themselves in the non-scoring case, by changing MUST clauses to FILTER clauses, or removing fully optional SHOULD clauses.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 10m
                  2h 10m