Skip to content

Commit 1c4104a

Browse files
committed
Revert "Disable merging null options?"
This reverts commit 2ef8b1d.
1 parent aa12294 commit 1c4104a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,9 +1247,11 @@ private static boolean canMergeIndexOptions(SemanticTextIndexOptions previous, S
12471247
return true;
12481248
}
12491249

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

0 commit comments

Comments
 (0)