Skip to content

Commit

Permalink
Minor simplifications
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosdelest committed Nov 30, 2023
1 parent 6bd9d36 commit d5d16fd
Showing 1 changed file with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,12 @@ public SemanticTextFieldMapper build(MapperBuilderContext context) {
public static class SemanticTextFieldType extends SimpleMappedFieldType {

private final SparseVectorFieldMapper.SparseVectorFieldType sparseVectorFieldType;
private final SparseVectorFieldMapper.SparseVectorFieldType sparseVectorFieldTypeForSearch;

private final String modelId;

public SemanticTextFieldType(String name, String modelId, Map<String, String> meta) {
super(name, true, false, false, TextSearchInfo.NONE, meta);
this.sparseVectorFieldType = new SparseVectorFieldMapper.SparseVectorFieldType(
SemanticTextInferenceResultFieldMapper.NAME + "." + name + "." + "inference",
meta
);
this.sparseVectorFieldTypeForSearch = new SparseVectorFieldMapper.SparseVectorFieldType(
name + "." + "inference",
meta
);
Expand All @@ -98,10 +93,6 @@ public String modelId() {
return modelId;
}

public SparseVectorFieldMapper.SparseVectorFieldType getSparseVectorFieldType() {
return this.sparseVectorFieldType;
}

@Override
public String typeName() {
return CONTENT_TYPE;
Expand All @@ -113,7 +104,7 @@ public String getInferenceModel() {

@Override
public Query termQuery(Object value, SearchExecutionContext context) {
return sparseVectorFieldTypeForSearch.termQuery(value, context);
return sparseVectorFieldType.termQuery(value, context);
}

@Override
Expand Down

0 comments on commit d5d16fd

Please sign in to comment.