Skip to content

Commit 2ef8b1d

Browse files
committed
Disable merging null options?
1 parent f6d58a1 commit 2ef8b1d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
import org.elasticsearch.inference.InferenceResults;
7070
import org.elasticsearch.inference.MinimalServiceSettings;
7171
import org.elasticsearch.inference.SimilarityMeasure;
72+
import org.elasticsearch.script.field.vectors.DenseVector;
7273
import org.elasticsearch.search.fetch.StoredFieldsSpec;
7374
import org.elasticsearch.search.lookup.Source;
7475
import org.elasticsearch.search.vectors.KnnVectorQueryBuilder;
@@ -1247,11 +1248,9 @@ private static boolean canMergeIndexOptions(SemanticTextIndexOptions previous, S
12471248
return true;
12481249
}
12491250

1250-
if (previous == null || current == null) {
1251-
return true;
1252-
}
1253-
1254-
if (Objects.equals(previous.type(), current.type()) == false) {
1251+
SemanticTextIndexOptions.SupportedIndexOptions previousType = (previous != null ? previous.type() : null);
1252+
SemanticTextIndexOptions.SupportedIndexOptions currentType = (current != null ? current.type() : null);
1253+
if (Objects.equals(previousType, currentType) == false) {
12551254
conflicts.addConflict(INDEX_OPTIONS_FIELD, "Incompatible index options");
12561255
}
12571256

0 commit comments

Comments
 (0)