All Implemented Interfaces:
Closeable, AutoCloseable, Operator, org.elasticsearch.core.Releasable

public class MMROperator extends CompleteInputCollectorOperator
ES|QL Operator for performing MMR result diversification MMR performs result diversification on incoming results using maximum marginal relevance. The input is a set of limited rows, where at least one field is a dense vector to use for vector comparison. The output is a reduced set of results, in the same order as the input, but "diversified" to be results that are semantically diverse from each other within the input set.
  • Method Details

    • onFinished

      protected void onFinished()
      Description copied from class: CompleteInputCollectorOperator
      Called when he base finish() call is completed
      Specified by:
      onFinished in class CompleteInputCollectorOperator
    • isOperatorFinished

      protected boolean isOperatorFinished()
      Description copied from class: CompleteInputCollectorOperator
      Adds any additional checks to ensure the subclass is finished
      Specified by:
      isOperatorFinished in class CompleteInputCollectorOperator
      Returns:
      true if the subclass is finished
    • onGetOutput

      protected Page onGetOutput()
      Description copied from class: CompleteInputCollectorOperator
      Implementation to retrieve the output pages. Will only run if `isFinished()` is true
      Specified by:
      onGetOutput in class CompleteInputCollectorOperator
      Returns:
      the output page (or null if not ready or none)
    • onClose

      protected void onClose()
      Description copied from class: CompleteInputCollectorOperator
      Additional implementation for closing out the subclass
      Specified by:
      onClose in class CompleteInputCollectorOperator
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • canProduceMoreDataWithoutExtraInput

      public boolean canProduceMoreDataWithoutExtraInput()
      Description copied from interface: Operator
      Returns 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 return true:

      • Operators with internal buffers (e.g., AsyncOperator with pending results)
      • Operators processing a single input page into multiple output pages
      • Aggregation operators that buffer partial results
      Returns:
      true if the operator has buffered data that can produce output, false otherwise
    • status

      public Operator.Status status()
      Description copied from interface: Operator
      The status of the operator.