查询语句:
结果:
我搜索的2017,却高亮到了2017MV
检查了下规律是,如果数据里面,数字和英文字母连在一起,搜索数字将会出现这个问题
版本
es: 5.5.3
ik: 5.5.3
pinyin: 5.5.3
分词配置如下:
{
"query" : {
"match" : {
"title" : "2017"
}
},
"highlight": {
"fields" : {
"title" : {}
}
}
}
结果:
{
"took": 15,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 23,
"max_score": 8.155465,
"hits": [
{
"_index": "room_search",
"_type": "db_room_video",
"_id": "fd0525c54c784dbf8881fb5115da290c",
"_score": 8.155465,
"_source": {
"id": "fd0525c54c784dbf8881fb5115da290c",
"title": "后摇/英伦/地下民谣 专场-Blondie 2017MV"
},
"highlight": {
"title": [
"后摇/英伦/地下民谣 专场-Blondie <em>2017MV</em>"
]
}
}
]
}
}
我搜索的2017,却高亮到了2017MV
检查了下规律是,如果数据里面,数字和英文字母连在一起,搜索数字将会出现这个问题
版本
es: 5.5.3
ik: 5.5.3
pinyin: 5.5.3
分词配置如下:
{
"settings": {
"index": {
"analysis": {
"analyzer": {
"index_ik_pinyin": {
"type": "custom",
"tokenizer": "ik_max_word",
"filter": ["index_pinyin", "word_delimiter"]
}
},
"filter": {
"index_pinyin": {
"keep_original" : true,
"keep_joined_full_pinyin": true,
"type" : "pinyin",
"term_vector": "with_positions_offsets"
}
}
}
}
},
"mappings": {
"db_room_video": {
"_all": {
"enabled": false
},
"properties": {
"title": {
"type": "text",
"analyzer" : "index_ik_pinyin",
"search_analyzer" : "ik_max_word"
}
}
}
}
}
1 个回复
medcl - 今晚打老虎。
赞同来自: