Skip to content

Commit

Permalink
Removed redundant modelId
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosdelest committed Dec 11, 2023
1 parent 4b06655 commit 39e061f
Showing 1 changed file with 2 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -89,24 +82,14 @@ 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 };
}

@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);
}
}

Expand Down

0 comments on commit 39e061f

Please sign in to comment.