From d5d16fdfbeae86e474966213616a74656f245374 Mon Sep 17 00:00:00 2001 From: carlosdelest Date: Thu, 30 Nov 2023 10:58:05 +0100 Subject: [PATCH] Minor simplifications --- .../xpack/ml/mapper/SemanticTextFieldMapper.java | 11 +---------- 1 file changed, 1 insertion(+), 10 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 813e6fbb0d70b..87df6559426f6 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 @@ -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 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 ); @@ -98,10 +93,6 @@ public String modelId() { return modelId; } - public SparseVectorFieldMapper.SparseVectorFieldType getSparseVectorFieldType() { - return this.sparseVectorFieldType; - } - @Override public String typeName() { return CONTENT_TYPE; @@ -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