Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
8be20f0
RRFRetrieverComponent added:
mridula-s109 Jul 4, 2025
a8f6487
Modified parser, toXcontent and included component in the RetrieverBu…
mridula-s109 Jul 4, 2025
e07c38d
[CI] Auto commit changes from spotless
Jul 4, 2025
33d3da4
Resolved merge conflicts
mridula-s109 Jul 15, 2025
5fb5568
Merge branch 'main' into SEARCH-1026-implement-support-for-weighted-rrf
mridula-s109 Jul 15, 2025
3ba149c
Fixed compile issues in tests
mridula-s109 Jul 15, 2025
d5749f6
[CI] Auto commit changes from spotless
Jul 15, 2025
7614936
trying to resolve parse errros
mridula-s109 Jul 16, 2025
a5d9e34
wip
ioanatia Jul 17, 2025
0640099
Modified builder
mridula-s109 Jul 17, 2025
cec23c2
[CI] Auto commit changes from spotless
Jul 17, 2025
6da9e15
Removed unnecessary code
mridula-s109 Jul 18, 2025
51b350e
Fixed import
mridula-s109 Jul 18, 2025
4050a3a
Merge branch 'main' into SEARCH-1026-implement-support-for-weighted-rrf
mridula-s109 Jul 18, 2025
ea664eb
Enhanced tests
mridula-s109 Jul 18, 2025
98e72be
Fixed the failing tests
mridula-s109 Jul 21, 2025
7de8c7a
Merge branch 'main' into SEARCH-1026-implement-support-for-weighted-rrf
mridula-s109 Jul 21, 2025
c778dd2
Yaml tests were added
mridula-s109 Jul 22, 2025
c7b331d
Added cluster features to it
mridula-s109 Jul 22, 2025
f543cbe
Fixed spotless
mridula-s109 Jul 22, 2025
75ab8d0
Merge branch 'main' into SEARCH-1026-implement-support-for-weighted-rrf
mridula-s109 Jul 22, 2025
f5086c1
Update docs/changelog/130658.yaml
mridula-s109 Jul 22, 2025
fafb50f
Fixed the relaxed constraints
mridula-s109 Jul 23, 2025
e535864
Resolving issues
mridula-s109 Jul 23, 2025
78f8641
Resolved PR comments
mridula-s109 Jul 23, 2025
02647b1
removed simplified rrf
mridula-s109 Jul 23, 2025
2010f3a
changed the test file back to its original state
mridula-s109 Jul 24, 2025
7433023
Resolved comments to have ahelper method and the test case to use it
mridula-s109 Jul 24, 2025
a2bf4de
made parsing robust
mridula-s109 Jul 24, 2025
eebf577
Merge branch 'main' into SEARCH-1026-implement-support-for-weighted-rrf
mridula-s109 Jul 24, 2025
0388abd
Merge branch 'main' into SEARCH-1026-implement-support-for-weighted-rrf
mridula-s109 Jul 24, 2025
74ed8db
IT test reverted
mridula-s109 Jul 24, 2025
6d7e8ff
Replaced the declareString array parser
mridula-s109 Jul 25, 2025
f1e14ce
Enforced weights as nonnull
mridula-s109 Jul 25, 2025
fd30387
Fixed the weights null
mridula-s109 Jul 25, 2025
3a82a28
Empty weight shouldnt be serialised
mridula-s109 Jul 25, 2025
77c14d3
[CI] Auto commit changes from spotless
Jul 25, 2025
45ca068
Merge branch 'main' into SEARCH-1026-implement-support-for-weighted-rrf
mridula-s109 Jul 25, 2025
2e121b0
removed the hard coding
mridula-s109 Jul 28, 2025
d66f5a6
Cleanup and optimised the code flow
mridula-s109 Jul 28, 2025
532e7df
Fixed the comments
mridula-s109 Jul 28, 2025
184330c
[CI] Auto commit changes from spotless
Jul 28, 2025
c43a075
optimised test
mridula-s109 Jul 28, 2025
e5f8079
Added additional test
mridula-s109 Jul 28, 2025
65cc528
Merge branch 'main' into SEARCH-1026-implement-support-for-weighted-rrf
mridula-s109 Jul 28, 2025
4ac4940
addressed the commentS
mridula-s109 Jul 29, 2025
e6f22bc
Merge branch 'main' into SEARCH-1026-implement-support-for-weighted-rrf
mridula-s109 Jul 29, 2025
3fc0d35
Update docs/changelog/130658.yaml
mridula-s109 Jul 31, 2025
5c364a0
Explicit check for retriever object
mridula-s109 Jul 31, 2025
978e182
Resolved PR comments
mridula-s109 Jul 31, 2025
032e946
Merge branch 'main' into SEARCH-1026-implement-support-for-weighted-rrf
mridula-s109 Jul 31, 2025
1d807ee
Fixed the error message
mridula-s109 Jul 31, 2025
7f4c7cd
Merge branch 'main' into SEARCH-1026-implement-support-for-weighted-rrf
mridula-s109 Jul 31, 2025
99f4ad2
Merge branch 'main' into SEARCH-1026-implement-support-for-weighted-rrf
mridula-s109 Jul 31, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public final class RRFRetrieverBuilder extends CompoundRetrieverBuilder<RRFRetri
public static final ParseField RANK_CONSTANT_FIELD = new ParseField("rank_constant");
public static final ParseField FIELDS_FIELD = new ParseField("fields");
public static final ParseField QUERY_FIELD = new ParseField("query");
public static final ParseField WEIGHTS_FIELD = new ParseField("weights");

public static final int DEFAULT_RANK_CONSTANT = 60;

Expand Down Expand Up @@ -92,7 +91,6 @@ public final class RRFRetrieverBuilder extends CompoundRetrieverBuilder<RRFRetri
PARSER.declareString(ConstructingObjectParser.optionalConstructorArg(), QUERY_FIELD);
PARSER.declareInt(ConstructingObjectParser.optionalConstructorArg(), RANK_WINDOW_SIZE_FIELD);
PARSER.declareInt(ConstructingObjectParser.optionalConstructorArg(), RANK_CONSTANT_FIELD);
PARSER.declareFloatArray(ConstructingObjectParser.optionalConstructorArg(), WEIGHTS_FIELD);
RetrieverBuilder.declareBaseParserFields(PARSER);
}

Expand Down Expand Up @@ -327,13 +325,6 @@ public void doToXContent(XContentBuilder builder, Params params) throws IOExcept

builder.field(RANK_WINDOW_SIZE_FIELD.getPreferredName(), rankWindowSize);
builder.field(RANK_CONSTANT_FIELD.getPreferredName(), rankConstant);
if (weights.length > 0) {
builder.startArray(WEIGHTS_FIELD.getPreferredName());
for (float weight : weights) {
builder.value(weight);
}
builder.endArray();
}
}

// ---- FOR TESTING XCONTENT PARSING ----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,7 @@ public static RRFRetrieverComponent fromXContent(XContentParser parser, Retrieve
parser.nextToken();
weight = parser.floatValue();
} else {
if (retriever != null) {
throw new ParsingException(parser.getTokenLocation(), "only one retriever can be specified");
}
throw new ParsingException(
parser.getTokenLocation(),
"unknown field [{}], expected [{}] or [{}]",
fieldName,
RETRIEVER_FIELD.getPreferredName(),
WEIGHT_FIELD.getPreferredName()
);
throw new ParsingException(parser.getTokenLocation(), "unknown field [{}] after retriever", fieldName);
}
} while (parser.nextToken() == XContentParser.Token.FIELD_NAME);

Expand All @@ -115,7 +106,8 @@ public static RRFRetrieverComponent fromXContent(XContentParser parser, Retrieve
} else {
RetrieverBuilder retriever = parser.namedObject(RetrieverBuilder.class, firstFieldName, context);
context.trackRetrieverUsage(retriever.getName());
while (parser.nextToken() != XContentParser.Token.END_OBJECT) {
if (parser.nextToken() != XContentParser.Token.END_OBJECT) {
throw new ParsingException(parser.getTokenLocation(), "unknown field [{}] after retriever", parser.currentName());
}
return new RRFRetrieverComponent(retriever, DEFAULT_WEIGHT);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public void testRRFRetrieverComponentErrorCases() throws IOException {
}
""";

expectParsingException(multipleRetrieversContent, "only one retriever can be specified");
expectParsingException(multipleRetrieversContent, "unknown field [standard] after retriever");

// Test case 2: Weight without retriever
String weightOnlyContent = """
Expand Down