自定义分析器问题 #41262
Replies: 2 comments 2 replies
-
this is not released yet? right now milvus don't support customized dict. |
Beta Was this translation helpful? Give feedback.
-
I'm assuming this is not supported until 2.6. I will double check with document team |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
analyzer_params = {
"tokenizer": {
"type": "jieba",
"dict": ["my_vocab"],
"mode": "search",
"hmm": False
}
}
schema.add_field(field_name="text", datatype=DataType.VARCHAR,
analyzer_params=analyzer_params,
max_length=2048,
enable_analyzer=True,
enable_match=True
)
当我自定义jieba分词器时,开启文本匹配 enable_match=True,在创建collection时会报错:
pymilvus.exceptions.MilvusException: <MilvusException: (code=2000, message=failed to validate text schema, C Runtime Exception: Assert "res.result_->success" => Tokenizer creation failed: create tokenizer failed with error: InternalError: tokenizer name should be string param: {"tokenizer":{"type":"jieba","dict":["default"],"mode":"search","hmm":false}} at /workspace/source/internal/core/thirdparty/tantivy/tokenizer.h:19
只有使用analyzer_params = {"tokenizer": "jieba"}才能成功创建
这意味着在开启文本匹配的情况下,无法使用自定义jieba分词器吗?
还有,在使用client.run_analyzer()时,会报错AttributeError: 'MilvusClient' object has no attribute 'run_analyzer'
Beta Was this translation helpful? Give feedback.
All reactions