Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-5388

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

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • 6.0
    • None

    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)

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            werder Andrey Kudryavtsev
            Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: