Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public class AddFieldReq {

// If a specific field, such as maxLength, has been specified, it will override the corresponding key's value in typeParams.
private Map<String, String> typeParams;
Map<String, Object> multiAnalyzerParams; // for multi‑language analyzers

AddFieldReq setDefaultValue(Object obj) {
enableDefaultValue = true; // automatically set this flag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ public CollectionSchema addField(AddFieldReq addFieldReq) {
.enableMatch(addFieldReq.getEnableMatch())
.analyzerParams(addFieldReq.getAnalyzerParams())
.typeParams(addFieldReq.getTypeParams())
.multiAnalyzerParams(addFieldReq.getMultiAnalyzerParams())
.build();
if (addFieldReq.getDataType().equals(DataType.Array)) {
if (addFieldReq.getElementType() == null) {
Expand Down Expand Up @@ -221,6 +222,7 @@ public static class FieldSchema {

// If a specific field, such as maxLength, has been specified, it will override the corresponding key's value in typeParams.
private Map<String, String> typeParams;
Map<String, Object> multiAnalyzerParams; // for multi‑language analyzers
}

@Data
Expand Down
4 changes: 4 additions & 0 deletions sdk-core/src/main/java/io/milvus/v2/utils/SchemaUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ public static FieldSchema convertToGrpcFieldSchema(CreateCollectionReq.FieldSche
String params = JsonUtils.toJson(fieldSchema.getAnalyzerParams());
typeParams.put("analyzer_params", params);
}
if (fieldSchema.getMultiAnalyzerParams() != null) {
String params = JsonUtils.toJson(fieldSchema.getMultiAnalyzerParams());
typeParams.put("multi_analyzer_params", params);
}

List<KeyValuePair> typeParamsList = AssembleKvPair(typeParams);
if (CollectionUtils.isNotEmpty(typeParamsList)) {
Expand Down
Loading