diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/rescorer/LearnToRankRescorerBuilder.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/rescorer/LearnToRankRescorerBuilder.java index 494af0310953a..bc3348696e959 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/rescorer/LearnToRankRescorerBuilder.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/rescorer/LearnToRankRescorerBuilder.java @@ -343,8 +343,8 @@ protected void doWriteTo(StreamOutput out) throws IOException { protected void doXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(NAME); builder.field(MODEL_FIELD.getPreferredName(), modelId); - if (params != null) { - builder.field(PARAMS_FIELD.getPreferredName(), params); + if (this.params != null) { + builder.field(PARAMS_FIELD.getPreferredName(), this.params); } builder.endObject(); } diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/inference_rescore.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/learn_to_rank_rescorer.yml similarity index 95% rename from x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/inference_rescore.yml rename to x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/learn_to_rank_rescorer.yml index 824999b3b3008..a0ae4b7c44316 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/inference_rescore.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/learn_to_rank_rescorer.yml @@ -146,7 +146,7 @@ setup: { "rescore": { "window_size": 10, - "inference": { "model_id": "ltr-model" } + "learn_to_rank": { "model_id": "ltr-model" } } } - match: { hits.hits.0._score: 17.0 } @@ -162,7 +162,7 @@ setup: "query": {"term": {"product": "Laptop"}}, "rescore": { "window_size": 10, - "inference": { "model_id": "ltr-model" } + "learn_to_rank": { "model_id": "ltr-model" } } } - match: { hits.hits.0._score: 6.0 } @@ -182,7 +182,7 @@ setup: { "rescore": { "window_size": 2, - "inference": { "model_id": "ltr-model" } + "learn_to_rank": { "model_id": "ltr-model" } } } - match: { hits.hits.0._score: 17.0 } @@ -209,7 +209,7 @@ setup: }, { "window_size": 3, - "inference": { "model_id": "ltr-model" } + "learn_to_rank": { "model_id": "ltr-model" } }, { "window_size": 2, @@ -232,7 +232,7 @@ setup: { "rescore": { "window_size": 10, - "inference": { "model_id": "ltr-missing" } + "learn_to_rank": { "model_id": "ltr-missing" } } } --- @@ -245,7 +245,7 @@ setup: "query": {"term": {"product": "Speaker"}}, "rescore": { "window_size": 10, - "inference": { "model_id": "ltr-model" } + "learn_to_rank": { "model_id": "ltr-model" } } } - length: { hits.hits: 0 }