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.
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)