As described in the linked syntax document. This should be an extension to $setWindowFields.
Shorthand:
$minMaxScaler: <numeric expression>
Or extended:
$minMaxScaler: { input: <numeric expression>, min: <constant numeric expression>, max: <constant numeric expression> }
Using the defaults for min and max (0 and 1 respectively), given a sequence of numbers in the window
X = x0, x1, … xn, this will calculate:
minMaxScaler(xi) =(xi -min(X)) / (max(X) -min(X))
Now adding parameters smin and smax, for the fully general case we get:
minMaxScaler(xi, smin, smax) =((xi -min(X)) / (max(X) -min(X))*(smax-smin) +smin
You can see that these new terms just adjust the value between 0 and 1 to be in the domain (smin, smax)
For this ticket, only implement the removable window implementations of the window function, to break up how much scope this ticket covers. This means no left unbounded document windows will be supported. A follow up ticket will add in the removable window implementation.
- is depended on by
-
SERVER-94600 Add 'minMaxScalar' normalization option to $score stage
- Open
-
SERVER-95229 Support non-removable window implementations for $minMaxScalar window function
- Open
-
SERVER-94660 Test $rankFusion query shape and stable API restrictions
- Open
-
SERVER-91279 Add example rank fusion tests which use $setWindowFields
- Closed
-
SERVER-95171 Add example score fusion tests which use $setWindowFields
- Open
- is duplicated by
-
SERVER-92122 Add a $minMaxScaler window function
- Closed
- is related to
-
SERVER-94598 Add $score stage for hybrid search
- Closed
-
SERVER-95508 Use IDL to help parse ExpressionMinMaxScalar
- Backlog