mapping将字段的analyzer设置为ik_smart,search_analyzer设置为ik_smart后,highlight不生效的问题
匿名 | 发布于2018年04月08日 | 阅读数:10083{
"mappings": {
"_default_": {
"properties": {
"problemId": {
"include_in_all": false,
"index": true,
"type": "keyword"
},
"standardQuestion": {
"include_in_all": true,
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
},
"analyzer": "ik_smart"
},
"smsAnswer": {
"include_in_all": true,
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
},
"analyzer": "ik_smart"
},
"innerAnswer": {
"include_in_all": true,
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
},
"analyzer": "ik_smart"
},
"kmLikeAskList": {
"type": "object",
"properties": {
"askId": {
"include_in_all": false,
"index": true,
"type": "keyword"
},
"problemId": {
"include_in_all": false,
"index": true,
"type": "keyword"
},
"askQuestion": {
"include_in_all": true,
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
},
"analyzer": "ik_smart"
}
}
}
}
}
},
"_all": {
"store": "false",
"search_analyzer": "ik_smart",
"analyzer": "ik_smart",
"term_vector": "no"
}
}
2 个回复
wuzx
赞同来自:
laoyang360 - 《一本书讲透Elasticsearch》作者,Elastic认证工程师 [死磕Elasitcsearch]知识星球地址:http://t.cn/RmwM3N9;微信公众号:铭毅天下; 博客:https://elastic.blog.csdn.net
赞同来自:
你可以通过分词验证下你要的高亮字段smart分词是否存在?
验证方法:GET /ik_index/_analyze?analyzer=ik_smart
{
"text":"公路局正在治理解放大道路面积水问题"
}
text换成你的文档