mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
enhance: add multiAnalyzerParams for Go SDK (#41814)
relate: https://github.com/milvus-io/milvus/issues/41213 Signed-off-by: yhmo <yihua.mo@zilliz.com>
This commit is contained in:
parent
36e9e41627
commit
b0f4b904cd
@ -398,6 +398,15 @@ func (f *Field) WithAnalyzerParams(params map[string]any) *Field {
|
||||
return f
|
||||
}
|
||||
|
||||
func (f *Field) WithMultiAnalyzerParams(params map[string]any) *Field {
|
||||
if f.TypeParams == nil {
|
||||
f.TypeParams = make(map[string]string)
|
||||
}
|
||||
bs, _ := json.Marshal(params)
|
||||
f.TypeParams["multi_analyzer_params"] = string(bs)
|
||||
return f
|
||||
}
|
||||
|
||||
func (f *Field) WithEnableMatch(enable bool) *Field {
|
||||
if f.TypeParams == nil {
|
||||
f.TypeParams = make(map[string]string)
|
||||
|
||||
@ -29,7 +29,7 @@ func TestFieldSchema(t *testing.T) {
|
||||
NewField().WithName("partition_key").WithDataType(FieldTypeInt32).WithIsPartitionKey(true),
|
||||
NewField().WithName("array_field").WithDataType(FieldTypeArray).WithElementType(FieldTypeBool).WithMaxCapacity(128),
|
||||
NewField().WithName("clustering_key").WithDataType(FieldTypeInt32).WithIsClusteringKey(true),
|
||||
NewField().WithName("varchar_text").WithDataType(FieldTypeVarChar).WithMaxLength(65535).WithEnableAnalyzer(true).WithAnalyzerParams(map[string]any{}).WithEnableMatch(true),
|
||||
NewField().WithName("varchar_text").WithDataType(FieldTypeVarChar).WithMaxLength(65535).WithEnableAnalyzer(true).WithAnalyzerParams(map[string]any{}).WithMultiAnalyzerParams(map[string]any{}).WithEnableMatch(true),
|
||||
|
||||
NewField().WithName("default_value_bool").WithDataType(FieldTypeBool).WithDefaultValueBool(true),
|
||||
NewField().WithName("default_value_int").WithDataType(FieldTypeInt32).WithDefaultValueInt(1),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user