Module org.elasticsearch.compute
Class LinearScoreEvalOperator
java.lang.Object
org.elasticsearch.compute.operator.CompleteInputCollectorOperator
org.elasticsearch.compute.operator.fuse.LinearScoreEvalOperator
- All Implemented Interfaces:
Closeable,AutoCloseable,Operator,org.elasticsearch.core.Releasable
Updates the score column in two stages:
1. Normalizes the scores using the normalization method specified in the config. Each row belongs
to a result group which is specified by the discriminator column. Scores are normalized for each result group.
2. Multiplies the normalized score by the weight specified in the config. The config contains the weights that
we need to apply for each result group.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final recordNested classes/interfaces inherited from interface org.elasticsearch.compute.operator.Operator
Operator.OperatorFactory -
Field Summary
Fields inherited from class org.elasticsearch.compute.operator.CompleteInputCollectorOperator
finished, inputPages, pagesReceived, rowsReceivedFields inherited from interface org.elasticsearch.compute.operator.Operator
MIN_TARGET_PAGE_SIZE, NOT_BLOCKED, TARGET_PAGE_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionLinearScoreEvalOperator(DriverContext driverContext, int discriminatorPosition, int scorePosition, LinearConfig config, WarningSourceLocation source) -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if the operator can produce more output pages without requiring additional input pages.protected booleanAdds any additional checks to ensure the subclass is finishedprotected voidonClose()Additional implementation for closing out the subclassprotected voidCalled when he base finish() call is completedprotected PageImplementation to retrieve the output pages.status()The status of the operator.toString()Methods inherited from class org.elasticsearch.compute.operator.CompleteInputCollectorOperator
addInput, close, finish, getOutput, isFinished, needsInput
-
Constructor Details
-
LinearScoreEvalOperator
public LinearScoreEvalOperator(DriverContext driverContext, int discriminatorPosition, int scorePosition, LinearConfig config, WarningSourceLocation source)
-
-
Method Details
-
onFinished
protected void onFinished()Description copied from class:CompleteInputCollectorOperatorCalled when he base finish() call is completed- Specified by:
onFinishedin classCompleteInputCollectorOperator
-
isOperatorFinished
protected boolean isOperatorFinished()Description copied from class:CompleteInputCollectorOperatorAdds any additional checks to ensure the subclass is finished- Specified by:
isOperatorFinishedin classCompleteInputCollectorOperator- Returns:
- true if the subclass is finished
-
onGetOutput
Description copied from class:CompleteInputCollectorOperatorImplementation to retrieve the output pages. Will only run if `isFinished()` is true- Specified by:
onGetOutputin classCompleteInputCollectorOperator- Returns:
- the output page (or null if not ready or none)
-
onClose
protected void onClose()Description copied from class:CompleteInputCollectorOperatorAdditional implementation for closing out the subclass- Specified by:
onClosein classCompleteInputCollectorOperator
-
canProduceMoreDataWithoutExtraInput
public boolean canProduceMoreDataWithoutExtraInput()Description copied from interface:OperatorReturns true if the operator can produce more output pages without requiring additional input pages. This is useful for operators that buffer data or have internal state that can produce multiple output pages.Operators that do not buffer data should return
false- they cannot produce pages out of thin air. Examples of operators that may returntrue:- Operators with internal buffers (e.g.,
AsyncOperatorwith pending results) - Operators processing a single input page into multiple output pages
- Aggregation operators that buffer partial results
- Returns:
trueif the operator has buffered data that can produce output,falseotherwise
- Operators with internal buffers (e.g.,
-
toString
-
status
Description copied from interface:OperatorThe status of the operator.
-