Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
d2dc737
initial MMROperator and base diversification
markjhoy Jan 27, 2026
c6273e3
add _score block input
markjhoy Jan 27, 2026
6b6c25a
Merge branch 'main' into markjhoy/esql_mmr_command_operator_execution
markjhoy Jan 27, 2026
be4128c
working MMR output;CompleteInputCollectorOperator
markjhoy Jan 28, 2026
471cbb1
Merge branch 'main' into markjhoy/esql_mmr_command_operator_execution
markjhoy Jan 28, 2026
bc32155
add status; add tests; light refactoring
markjhoy Jan 29, 2026
aadf47a
remove dependency on _doc vector input block
markjhoy Jan 29, 2026
23a7a19
Merge branch 'main' into markjhoy/esql_mmr_command_operator_execution
markjhoy Jan 29, 2026
ab60c91
Merge branch 'main' into markjhoy/esql_mmr_command_operator_execution
markjhoy Jan 29, 2026
70d0987
fix bad merge
markjhoy Jan 29, 2026
5036553
realize queryVector/lambda as VectorData/Float
markjhoy Jan 29, 2026
b3d542e
fix MMRExec input params
markjhoy Jan 29, 2026
b6b4e1c
update grammar to ensure ON is specified
markjhoy Jan 29, 2026
18ae42b
add status tests
markjhoy Jan 30, 2026
d82caf1
start of MMR csv tests
markjhoy Jan 30, 2026
d613fa4
Merge branch 'main' into markjhoy/esql_mmr_command_operator_execution
markjhoy Jan 30, 2026
dabd6fa
re-add writable for MMRExec
markjhoy Jan 30, 2026
9dd97b4
revert csvtests change
markjhoy Jan 30, 2026
66e16d3
Merge branch 'main' into markjhoy/esql_mmr_command_operator_execution
markjhoy Jan 31, 2026
4498d96
regen ANTLR grammar from last merge
markjhoy Jan 31, 2026
dca5109
additional CSV tests
markjhoy Jan 31, 2026
ee663d9
light fix csv tests for stability
markjhoy Feb 1, 2026
311f31e
Merge branch 'main' into markjhoy/esql_mmr_command_operator_execution
markjhoy Feb 2, 2026
2719291
drop text_vector column in output from CSV tests
markjhoy Feb 2, 2026
f8b2334
add KNN subquery and TEXT_EMBEDDING fxn query vec
markjhoy Feb 2, 2026
58e5b30
add temp capability for BWC tests
markjhoy Feb 2, 2026
dc50332
Merge branch 'main' into markjhoy/esql_mmr_command_operator_execution
markjhoy Feb 2, 2026
dabce01
add sort for tests
markjhoy Feb 2, 2026
e369b11
Merge branch 'main' into markjhoy/esql_mmr_command_operator_execution
markjhoy Feb 2, 2026
de7e5a2
Merge branch 'main' into markjhoy/esql_mmr_command_operator_execution
markjhoy Feb 3, 2026
6e9ea12
[CI] Auto commit changes from spotless
Feb 3, 2026
d72408f
Merge branch 'main' into markjhoy/esql_mmr_command_operator_execution
markjhoy Feb 3, 2026
ddfbf39
Merge branch 'main' into markjhoy/esql_mmr_command_operator_execution
markjhoy Feb 3, 2026
6cae905
comment cleanup
markjhoy Feb 3, 2026
9e2bbcd
light cleanups and refactoring
markjhoy Feb 5, 2026
c00fc3d
Merge branch 'main' into markjhoy/esql_mmr_command_operator_execution
markjhoy Feb 5, 2026
86b3538
[CI] Auto commit changes from spotless
Feb 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions server/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -514,4 +514,5 @@
exports org.elasticsearch.index.mapper.blockloader.docvalues;
exports org.elasticsearch.index.mapper.blockloader.docvalues.fn;
exports org.elasticsearch.readiness to org.elasticsearch.internal.sigterm;
exports org.elasticsearch.search.diversification.mmr;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

package org.elasticsearch.compute.operator;

import org.elasticsearch.compute.data.Page;
import org.elasticsearch.core.Releasables;

import java.util.ArrayDeque;
import java.util.Deque;

/**
* A base class that loads in and works across all input pages for an operator
*/
public abstract class CompleteInputCollectorOperator implements Operator {

protected boolean finished;
protected final Deque<Page> inputPages = new ArrayDeque<>();
protected int pagesReceived = 0;
protected long rowsReceived = 0;

protected CompleteInputCollectorOperator() {
this.finished = false;
}

@Override
public boolean needsInput() {
return finished == false;
}

@Override
public void addInput(Page page) {
inputPages.add(page);
pagesReceived++;
rowsReceived += page.getPositionCount();
}

@Override
public void finish() {
if (finished == false) {
finished = true;
onFinished();
}
}

@Override
public boolean isFinished() {
return finished && isOperatorFinished();
}

@Override
public Page getOutput() {
if (finished == false || isOperatorFinished()) {
return null;
}

return onGetOutput();
}

@Override
public void close() {
Releasables.close(inputPages);
onClose();
}

/**
* Called when he base finish() call is completed
*/
protected abstract void onFinished();

/**
* Adds any additional checks to ensure the subclass is finished
* @return true if the subclass is finished
*/
protected abstract boolean isOperatorFinished();

/**
* Implementation to retrieve the output pages. Will only run if `isFinished()` is true
* @return the output page (or null if not ready or none)
*/
protected abstract Page onGetOutput();

/**
* Additional implementation for closing out the subclass
*/
protected abstract void onClose();
}
Loading