Skip to content

Commit

Permalink
Fix errors in the rewrite tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
afoucret committed Nov 16, 2023
1 parent 22609c3 commit f40f02f
Showing 1 changed file with 13 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,6 @@ public static LearnToRankRescorerBuilder fromXContent(
this.scriptService = null;
}

public LearnToRankRescorerBuilder(StreamInput input, ModelLoadingService modelLoadingService, ScriptService scriptService)
throws IOException {
super(input);
this.modelId = input.readString();
this.params = input.readMap();
this.learnToRankConfig = input.readOptionalNamedWriteable(LearnToRankConfig.class);

this.modelLoadingService = modelLoadingService;
this.scriptService = scriptService;

this.localModel = null;
}

LearnToRankRescorerBuilder(LearnToRankConfig learnToRankConfig, LocalModel localModel) {
this.modelId = localModel.getModelId();
this.learnToRankConfig = learnToRankConfig;
Expand All @@ -128,6 +115,19 @@ public LearnToRankRescorerBuilder(StreamInput input, ModelLoadingService modelLo
this.scriptService = null;
}

public LearnToRankRescorerBuilder(StreamInput input, ModelLoadingService modelLoadingService, ScriptService scriptService)
throws IOException {
super(input);
this.modelId = input.readString();
this.params = input.readMap();
this.learnToRankConfig = input.readOptionalNamedWriteable(LearnToRankConfig.class);

this.modelLoadingService = modelLoadingService;
this.scriptService = scriptService;

this.localModel = null;
}

public String modelId() {
return modelId;
}
Expand Down Expand Up @@ -331,10 +331,6 @@ private RescorerBuilder<LearnToRankRescorerBuilder> doSearchRewrite(QueryRewrite
@Override
protected LearnToRankRescorerContext innerBuildContext(int windowSize, SearchExecutionContext context) {
rescoreOccurred = true;

assert learnToRankConfig != null;
assert localModel != null;

return new LearnToRankRescorerContext(windowSize, LearnToRankRescorer.INSTANCE, learnToRankConfig, localModel, context);
}

Expand Down

0 comments on commit f40f02f

Please sign in to comment.