文件名 “PD1728_A_1”,创建索引和搜索都使用ik_max_word, 但是使用搜索词 PD1728 无法匹配到。通过 _analyze
{"analyzer":"ik_max_word","text":"PD1728_A_1.1.1"}
{
"tokens": [
{
"token": "pd1728_a_1.1.1",
"start_offset": 0,
"end_offset": 14,
"type": "LETTER",
"position": 0
},
{
"token": "pd",
"start_offset": 0,
"end_offset": 2,
"type": "ENGLISH",
"position": 1
},
{
"token": "1728",
"start_offset": 2,
"end_offset": 6,
"type": "ARABIC",
"position": 2
},
{
"token": "a",
"start_offset": 7,
"end_offset": 8,
"type": "ENGLISH",
"position": 3
},
{
"token": "1.1.1",
"start_offset": 9,
"end_offset": 14,
"type": "ARABIC",
"position": 4
}
],
}
{"analyzer":"ik_max_word","text":"PD1728"}
{
"tokens": [
{
"token": "pd1728",
"start_offset": 0,
"end_offset": 6,
"type": "LETTER",
"position": 0
},
{
"token": "pd",
"start_offset": 0,
"end_offset": 2,
"type": "ENGLISH",
"position": 1
},
{
"token": "1728",
"start_offset": 2,
"end_offset": 6,
"type": "ARABIC",
"position": 2
}
],
}
{"analyzer":"ik_max_word","text":"PD1728_A_1.1.1"}
{
"tokens": [
{
"token": "pd1728_a_1.1.1",
"start_offset": 0,
"end_offset": 14,
"type": "LETTER",
"position": 0
},
{
"token": "pd",
"start_offset": 0,
"end_offset": 2,
"type": "ENGLISH",
"position": 1
},
{
"token": "1728",
"start_offset": 2,
"end_offset": 6,
"type": "ARABIC",
"position": 2
},
{
"token": "a",
"start_offset": 7,
"end_offset": 8,
"type": "ENGLISH",
"position": 3
},
{
"token": "1.1.1",
"start_offset": 9,
"end_offset": 14,
"type": "ARABIC",
"position": 4
}
],
}
{"analyzer":"ik_max_word","text":"PD1728"}
{
"tokens": [
{
"token": "pd1728",
"start_offset": 0,
"end_offset": 6,
"type": "LETTER",
"position": 0
},
{
"token": "pd",
"start_offset": 0,
"end_offset": 2,
"type": "ENGLISH",
"position": 1
},
{
"token": "1728",
"start_offset": 2,
"end_offset": 6,
"type": "ARABIC",
"position": 2
}
],
}
3 个回复
rochy - rochy_he
赞同来自:
可使用前缀查询试试
bellengao - 博客: https://www.jianshu.com/u/e0088e3e2127
赞同来自:
lxq - 93年,java
赞同来自: