Skip to content

Commit 24a7c67

Browse files
committed
Add tests
1 parent f875337 commit 24a7c67

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/InferenceFeatures.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import static org.elasticsearch.xpack.inference.mapper.SemanticTextFieldMapper.SEMANTIC_TEXT_EXCLUDE_SUB_FIELDS_FROM_FIELD_CAPS;
1919
import static org.elasticsearch.xpack.inference.mapper.SemanticTextFieldMapper.SEMANTIC_TEXT_INDEX_OPTIONS;
20+
import static org.elasticsearch.xpack.inference.mapper.SemanticTextFieldMapper.SEMANTIC_TEXT_INDEX_OPTIONS_WITH_DEFAULTS;
2021
import static org.elasticsearch.xpack.inference.mapper.SemanticTextFieldMapper.SEMANTIC_TEXT_SUPPORT_CHUNKING_CONFIG;
2122
import static org.elasticsearch.xpack.inference.queries.SemanticKnnVectorQueryRewriteInterceptor.SEMANTIC_KNN_FILTER_FIX;
2223
import static org.elasticsearch.xpack.inference.queries.SemanticKnnVectorQueryRewriteInterceptor.SEMANTIC_KNN_VECTOR_QUERY_REWRITE_INTERCEPTION_SUPPORTED;
@@ -64,7 +65,8 @@ public Set<NodeFeature> getTestFeatures() {
6465
SEMANTIC_TEXT_SUPPORT_CHUNKING_CONFIG,
6566
SEMANTIC_TEXT_MATCH_ALL_HIGHLIGHTER,
6667
SEMANTIC_TEXT_EXCLUDE_SUB_FIELDS_FROM_FIELD_CAPS,
67-
SEMANTIC_TEXT_INDEX_OPTIONS
68+
SEMANTIC_TEXT_INDEX_OPTIONS,
69+
SEMANTIC_TEXT_INDEX_OPTIONS_WITH_DEFAULTS
6870
);
6971
}
7072
}

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/mapper/SemanticTextFieldMapper.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ public class SemanticTextFieldMapper extends FieldMapper implements InferenceFie
140140
"semantic_text.exclude_sub_fields_from_field_caps"
141141
);
142142
public static final NodeFeature SEMANTIC_TEXT_INDEX_OPTIONS = new NodeFeature("semantic_text.index_options");
143+
public static final NodeFeature SEMANTIC_TEXT_INDEX_OPTIONS_WITH_DEFAULTS = new NodeFeature(
144+
"semantic_text.index_options_with_defaults"
145+
);
143146

144147
public static final String CONTENT_TYPE = "semantic_text";
145148
public static final String DEFAULT_ELSER_2_INFERENCE_ID = DEFAULT_ELSER_ID;

x-pack/plugin/inference/src/yamlRestTest/resources/rest-api-spec/test/inference/10_semantic_text_field_mapping.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,8 +838,8 @@ setup:
838838
---
839839
"Displaying default index_options with and without include_defaults":
840840
- requires:
841-
cluster_features: "semantic_text.index_options"
842-
reason: Index options introduced in 8.19.0
841+
cluster_features: "semantic_text.index_options_with_defaults"
842+
reason: Index options defaults support introduced in 9.2.0
843843

844844
# Semantic text defaults to BBQ HNSW starting in 8.19.0/9.1.0
845845
- do:

x-pack/plugin/inference/src/yamlRestTest/resources/rest-api-spec/test/inference/10_semantic_text_field_mapping_bwc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -740,8 +740,8 @@ setup:
740740
---
741741
"Displaying default index_options with and without include_defaults":
742742
- requires:
743-
cluster_features: "semantic_text.index_options"
744-
reason: Index options introduced in 8.19.0
743+
cluster_features: "semantic_text.index_options_with_defaults"
744+
reason: Index options defaults support introduced in 9.2.0
745745

746746
# Semantic text defaults to BBQ HNSW starting in 8.19.0/9.1.0
747747
- do:

0 commit comments

Comments
 (0)