Skip to content

Commit 1a6161b

Browse files
committed
Adding additional CSV test cases.
1 parent 4099079 commit 1a6161b

File tree

1 file changed

+44
-5
lines changed

1 file changed

+44
-5
lines changed

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

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
reranker using a single field
77
required_capability: rerank
8-
required_capability: match_function
8+
required_capability: match_operator_colon
99

1010
FROM books METADATA _score
1111
| WHERE title:"war and peace" AND author:"Tolstoy"
@@ -23,7 +23,7 @@ book_no:keyword | title:text | author
2323

2424
reranker using multiple fields
2525
required_capability: rerank
26-
required_capability: match_function
26+
required_capability: match_operator_colon
2727

2828
FROM books METADATA _score
2929
| WHERE title:"war and peace" AND author:"Tolstoy"
@@ -41,7 +41,7 @@ book_no:keyword | title:text | author
4141

4242
reranker after a limit
4343
required_capability: rerank
44-
required_capability: match_function
44+
required_capability: match_operator_colon
4545

4646
FROM books METADATA _score
4747
| WHERE title:"war and peace" AND author:"Tolstoy"
@@ -60,7 +60,7 @@ book_no:keyword | title:text | author:text
6060

6161
reranker before a limit
6262
required_capability: rerank
63-
required_capability: match_function
63+
required_capability: match_operator_colon
6464

6565
FROM books METADATA _score
6666
| WHERE title:"war and peace" AND author:"Tolstoy"
@@ -78,7 +78,7 @@ book_no:keyword | title:text | author:text
7878

7979
reranker add the _score column when missing
8080
required_capability: rerank
81-
required_capability: match_function
81+
required_capability: match_operator_colon
8282

8383
FROM books
8484
| WHERE title:"war and peace" AND author:"Tolstoy"
@@ -93,3 +93,42 @@ book_no:keyword | title:text | author
9393
9032 | War and Peace: A Novel (6 Volumes) | Tolstoy Leo | 0.02083333395421505
9494
2776 | The Devil and Other Stories (Oxford World's Classics) | Leo Tolstoy | 0.01515151560306549
9595
;
96+
97+
98+
reranker using another sort order
99+
required_capability: rerank
100+
required_capability: match_operator_colon
101+
102+
FROM books
103+
| WHERE title:"war and peace" AND author:"Tolstoy"
104+
| RERANK "war and peace" ON title WITH test_reranker
105+
| KEEP book_no, title, author, _score
106+
| SORT author, title
107+
| LIMIT 3
108+
;
109+
110+
book_no:keyword | title:text | author:text | _score:double
111+
4536 | War and Peace (Signet Classics) | [John Hockenberry, Leo Tolstoy, Pat Conroy] | 0.02222222276031971
112+
2776 | The Devil and Other Stories (Oxford World's Classics) | Leo Tolstoy | 0.01515151560306549
113+
5327 | War and Peace | Leo Tolstoy | 0.03846153989434242
114+
;
115+
116+
117+
reranker after RRF
118+
required_capability: fork
119+
required_capability: rrf
120+
required_capability: match_operator_colon
121+
122+
FROM books METADATA _id, _index, _score
123+
| FORK ( WHERE title:"Tolkien" | SORT _score, _id DESC | LIMIT 3 )
124+
( WHERE author:"Tolkien" | SORT _score, _id DESC | LIMIT 3 )
125+
| RRF
126+
| RERANK "Tolkien" ON title WITH test_reranker
127+
| LIMIT 2
128+
| KEEP book_no, title, author, _score
129+
;
130+
131+
book_no:keyword | title:keyword | author:keyword | _score:double
132+
5335 | Letters of J R R Tolkien | J.R.R. Tolkien | 0.02631578966975212
133+
2130 | The J. R. R. Tolkien Audio Collection | [Christopher Tolkien, John Ronald Reuel Tolkien] | 0.019607843831181526
134+
;

0 commit comments

Comments
 (0)