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

CustomScoreQuery should support multiple ValueSourceQueries

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.3
    • Component/s: core/search
    • Labels:
      None
    • Lucene Fields:
      Patch Available

      Description

      CustomScoreQuery's constructor currently accepts a subQuery, and a ValueSourceQuery. I would like it to accept multiple ValueSourceQueries. The workaround of nested CustomScoreQueries works for simple cases, but it quickly becomes either cumbersome to manage, or impossible to implement the desired function.

      This patch implements CustomMultiScoreQuery with my desired functionality, and refactors CustomScoreQuery to implement the special case of a CustomMultiScoreQuery with 0 or 1 ValueSourceQueries. This keeps the CustomScoreQuery API intact.

      This patch includes basic tests, more or less taken from the original implementation, and customized a bit to cover the new cases.

        Attachments

        1. CustomMultiQuery.v0.diff
          37 kB
          Kyle Maxwell
        2. CustomScoreQuery.v1.diff
          13 kB
          Kyle Maxwell
        3. lucene-1019-multi-vsq.patch
          25 kB
          Doron Cohen

          Issue Links

            Activity

              People

              • Assignee:
                doronc Doron Cohen
                Reporter:
                fizx Kyle Maxwell
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: