From 39e061fc9fc9e6e82712d81629081c4f49e885cb Mon Sep 17 00:00:00 2001 From: carlosdelest Date: Mon, 11 Dec 2023 16:12:21 +0100 Subject: [PATCH] Removed redundant modelId --- .../ml/mapper/SemanticTextFieldMapper.java | 21 ++----------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/mapper/SemanticTextFieldMapper.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/mapper/SemanticTextFieldMapper.java index 3c27d04a1356b..cf713546a071a 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/mapper/SemanticTextFieldMapper.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/mapper/SemanticTextFieldMapper.java @@ -42,15 +42,8 @@ private static SemanticTextFieldMapper toType(FieldMapper in) { public static final TypeParser PARSER = new TypeParser((n, c) -> new Builder(n), notInMultiFields(CONTENT_TYPE)); - private final String modelId; - - private SemanticTextFieldMapper(String simpleName, MappedFieldType mappedFieldType, String modelId, CopyTo copyTo) { + private SemanticTextFieldMapper(String simpleName, MappedFieldType mappedFieldType, CopyTo copyTo) { super(simpleName, mappedFieldType, MultiFields.empty(), copyTo); - this.modelId = modelId; - } - - public String getModelId() { - return modelId; } @Override @@ -89,11 +82,6 @@ public Builder(String name) { super(name); } - public Builder modelId(String modelId) { - this.modelId.setValue(modelId); - return this; - } - @Override protected Parameter[] getParameters() { return new Parameter[] { modelId, meta }; @@ -101,12 +89,7 @@ protected Parameter[] getParameters() { @Override public SemanticTextFieldMapper build(MapperBuilderContext context) { - return new SemanticTextFieldMapper( - name(), - new SemanticTextFieldType(name(), modelId.getValue(), meta.getValue()), - modelId.getValue(), - copyTo - ); + return new SemanticTextFieldMapper(name(), new SemanticTextFieldType(name(), modelId.getValue(), meta.getValue()), copyTo); } }