Skip to content

Commit

Permalink
rrf support old window_size
Browse files Browse the repository at this point in the history
(cherry picked from commit be9fa86)
  • Loading branch information
weizijun committed Jan 23, 2025
1 parent 5de3d08 commit 6ff618d
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
*/
public abstract class RankBuilder implements VersionedNamedWriteable, ToXContentObject {

public static final ParseField RANK_WINDOW_SIZE_FIELD = new ParseField("rank_window_size");
public static final ParseField RANK_WINDOW_SIZE_FIELD = new ParseField("rank_window_size", "window_size");

public static final int DEFAULT_RANK_WINDOW_SIZE = SearchService.DEFAULT_SIZE;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,40 @@ setup:
- match: { hits.hits.2.fields.text.0: "other" }
- match: { hits.hits.2.fields.keyword.0: "other" }

---
"Simple rank with old window_size param":

- requires:
cluster_features: ["gte_v8.16.0"]
reason: "deprecation added in 8.16"
test_runner_features: warnings

- do:
warnings:
- "Deprecated field [rank] used, replaced by [retriever]"
- "Deprecated field [window_size] used, expected [rank_window_size] instead"
search:
index: test
body:
track_total_hits: false
fields: [ "keyword" ]
knn:
field: vector
query_vector: [ 0.0 ]
k: 3
num_candidates: 3
query:
term:
text: term
rank:
rrf:
window_size: 100
rank_constant: 1
size: 1

- match: { hits.hits.0._id: "1" }
- match: { hits.hits.0.fields.keyword.0: "other" }

---
"Simple rank with multiple bm25 sub searches":

Expand Down

0 comments on commit 6ff618d

Please sign in to comment.