Solr
  1. Solr
  2. SOLR-5388

Combine def function with "multi" functions (max, min, sum, product)

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Trunk
    • Component/s: None
    • Labels:

      Description

      Ability for expressions like def(min(field1,..,fieldN), defValue) return defValue if document doesn't have value for any of this fields.
      Implement exists(int doc) method for FunctionValues created in MultiFloatFunction. Extract method to get ability other MultiFloatFunction implementation to override it.

      Example:
      Doc1: Field1: "10", Field2: "20"
      Doc2: Field3: "30", FIeld4: "40"
      We want to call user function "def(min(Field1,Field2),5)" for this documents :
      Now we've got: Doc1 = 10, Doc2 = Float.POSITIVE_INFINITY
      With this patch: Doc1 = 10, Doc2 = 5 ( Doc2 doesn't have values for this documents, so he gets defValue)

      1. SOLR-5388.patch
        6 kB
        Andrey Kudryavtsev
      2. SOLR-5388.patch
        1 kB
        Andrey Kudryavtsev

        Activity

        Hide
        Andrey Kudryavtsev added a comment -

        Couple of test cases added

        Show
        Andrey Kudryavtsev added a comment - Couple of test cases added

          People

          • Assignee:
            Unassigned
            Reporter:
            Andrey Kudryavtsev
          • Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development