Skip to content

Commit d0e1b99

Browse files
committed
Ensure STATS is working after RERANK / COMPLETION
1 parent 69d1dfe commit d0e1b99

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,17 @@ title:text | completion:keyword
5959
War and Peace | THIS IS A PROMPT: WAR AND PEACE
6060
War and Peace (Signet Classics) | THIS IS A PROMPT: WAR AND PEACE (SIGNET CLASSICS)
6161
;
62+
63+
completion followed by stats
64+
required_capability: completion
65+
required_capability: match_operator_colon
66+
67+
FROM books METADATA _score
68+
| WHERE title:"war and peace" AND author:"Tolstoy"
69+
| COMPLETION CONCAT("This is a prompt: ", title) WITH { "inference_id" : "test_completion" }
70+
| STATS count=COUNT(*), avg_completion_length = AVG(LENGTH(completion))
71+
;
72+
73+
count:long | avg_completion_length:double
74+
4 | 50.75
75+
;

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,3 +294,18 @@ The Lord of the Rings - Boxed Set | 3.76885509490
294294
Return of the King Being the Third Part of The Lord of the Rings | 3.6248698234558105 | 9.000900317914784E-4 | 0.001396648003719747
295295
// end::combine-result[]
296296
;
297+
298+
reranker followed by stats
299+
required_capability: rerank
300+
required_capability: match_operator_colon
301+
302+
FROM books METADATA _score
303+
| WHERE title:"war and peace" AND author:"Tolstoy"
304+
| SORT _score DESC, book_no ASC
305+
| RERANK "war and peace" ON title WITH { "inference_id" : "test_reranker" }
306+
| STATS count_book = COUNT(*) WHERE _score >= 0.03
307+
;
308+
309+
count_book:long
310+
2
311+
;

0 commit comments

Comments
 (0)