Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

高亮范围扩大 #259

Open
zwx0207 opened this issue Aug 29, 2021 · 0 comments
Open

高亮范围扩大 #259

zwx0207 opened this issue Aug 29, 2021 · 0 comments

Comments

@zwx0207
Copy link

zwx0207 commented Aug 29, 2021

对一个字段同时使用ik分词和拼音分词,对该字段进行搜索时,返回高亮范围扩大了,比如:
content字段使用了ik分词+拼音分词,有一条数据的content是“这是一个未命名的帖子”,现在对该字段进行搜索,搜索内容为“ming”,返回数据高亮为“未命名”,但是期望的结果是“命”和“名”高亮,这种情况有什么解决方案吗?
查询:
{
"query": {
"match": {
"content.fpy": "ming"
}
},
"highlight": {
"fields": {
"content.fpy": {}
}
}
}
结果:
"hits" : [
{
"_index" : "zwx_test2",
"_type" : "_doc",
"_id" : "vAfNj3sBAXo3GeO_puzJ",
"_score" : 0.51007897,
"_source" : {
"content" : "这是一个未命名的帖子"
},
"highlight" : {
"content.fpy" : [
"这是一个未命名的帖子"
]
}
}
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant