Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions docs/changelog/119724.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 119724
summary: rrf support the window_size parameter to compatible with old version
area: Search
type: bug
issues: []
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,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 @@ -104,6 +104,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