IK 分词器映射示例
IK 分词器映射示例
# Elasticsearch 安装 analysis-ik 插件后:
"content": {
"type": "text",
"analyzer": "ik_max_word", # 索引时细粒度
"search_analyzer": "ik_smart" # 查询时粗粒度
}自定义词典(品牌、型号、缩写)能明显改善专名召回;词典更新后需要重建索引,倒排才会生效。
中文 BM25 效果强依赖分词:IK(ik_max_word / ik_smart)与 jieba 等粒度不同、召回不同;产品型号与专名建议加入自定义词典保护。
# Elasticsearch 安装 analysis-ik 插件后:
"content": {
"type": "text",
"analyzer": "ik_max_word", # 索引时细粒度
"search_analyzer": "ik_smart" # 查询时粗粒度
}