Skip to content

Commit 59bde7d

Browse files
committed
Fix errors from merge
1 parent 53ab0ac commit 59bde7d

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

server/src/main/java/org/elasticsearch/index/mapper/vectors/DenseVectorFieldMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1520,7 +1520,7 @@ public static Optional<VectorIndexType> fromString(String type) {
15201520
this.quantized = quantized;
15211521
}
15221522

1523-
abstract IndexOptions parseIndexOptions(String fieldName, Map<String, ?> indexOptionsMap, IndexVersion indexVersion);
1523+
public abstract IndexOptions parseIndexOptions(String fieldName, Map<String, ?> indexOptionsMap, IndexVersion indexVersion);
15241524

15251525
public abstract boolean supportsElementType(ElementType elementType);
15261526

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
import org.elasticsearch.common.xcontent.XContentParserUtils;
1414
import org.elasticsearch.common.xcontent.support.XContentMapValues;
1515
import org.elasticsearch.core.Nullable;
16+
import org.elasticsearch.index.IndexVersion;
1617
import org.elasticsearch.index.IndexVersions;
18+
import org.elasticsearch.index.mapper.vectors.DenseVectorFieldMapper;
1719
import org.elasticsearch.inference.ChunkedInference;
1820
import org.elasticsearch.inference.MinimalServiceSettings;
1921
import org.elasticsearch.xcontent.ConstructingObjectParser;
@@ -126,7 +128,7 @@ static MinimalServiceSettings parseModelSettingsFromMap(Object node) {
126128
}
127129
}
128130

129-
static DenseVectorFieldMapper.IndexOptions parseIndexOptionsFromMap(String fieldName, Object node) {
131+
static DenseVectorFieldMapper.IndexOptions parseIndexOptionsFromMap(String fieldName, Object node, IndexVersion indexVersion) {
130132
if (node == null) {
131133
return null;
132134
}
@@ -140,7 +142,7 @@ static DenseVectorFieldMapper.IndexOptions parseIndexOptionsFromMap(String field
140142
XContentMapValues.nodeStringValue(type.toString(), null)
141143
).orElseThrow(() -> new IllegalArgumentException("Unsupported index options " + TYPE_FIELD + " [" + type + "]"));
142144

143-
return vectorIndexType.parseIndexOptions(fieldName, map);
145+
return vectorIndexType.parseIndexOptions(fieldName, map, indexVersion);
144146
} catch (Exception exc) {
145147
throw new ElasticsearchException(exc);
146148
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public static class Builder extends FieldMapper.Builder {
183183
INDEX_OPTIONS_FIELD,
184184
true,
185185
() -> null,
186-
(n, c, o) -> SemanticTextField.parseIndexOptionsFromMap(n, o),
186+
(n, c, o) -> SemanticTextField.parseIndexOptionsFromMap(n, o, c.indexVersionCreated()),
187187
mapper -> ((SemanticTextFieldType) mapper.fieldType()).indexOptions,
188188
XContentBuilder::field,
189189
Objects::toString

0 commit comments

Comments
 (0)