Skip to content

Commit 7b0aaa3

Browse files
committed
Fix RRF tests
1 parent 0ff3676 commit 7b0aaa3

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/RrfScoreEvalOperator.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,11 @@ protected Page process(Page page) {
6868
for (int i = 0; i < page.getBlockCount() - 1; i++) {
6969
projections[i] = i == scorePosition ? page.getBlockCount() - 1 : i;
7070
}
71-
72-
return page.projectBlocks(projections);
71+
try {
72+
return page.projectBlocks(projections);
73+
} finally {
74+
page.releaseBlocks();
75+
}
7376
}
7477

7578
@Override

x-pack/plugin/esql/qa/testFixtures/src/main/resources/rrf.csv-spec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ FROM semantic_text METADATA _id, _score, _index
120120
( WHERE semantic_text_field:"something else" | SORT _score DESC | LIMIT 2)
121121
| RRF
122122
| EVAL _score = round(_score, 4)
123+
| EVAL _fork = mv_sort(_fork)
123124
| KEEP _fork, _score, _id, semantic_text_field
124125
;
125126

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/RrfIT.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public void testRrf() {
4040
( WHERE content:"fox" | SORT _score, _id DESC )
4141
( WHERE content:"dog" | SORT _score, _id DESC )
4242
| RRF
43+
| EVAL _fork = mv_sort(_fork)
4344
| EVAL _score = round(_score, 4)
4445
| KEEP id, content, _score, _fork
4546
""";

0 commit comments

Comments
 (0)