-
Notifications
You must be signed in to change notification settings - Fork 191
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
6.5.4版本搜索返回为空 #167
Comments
"本田Urban EV谍照表示其车型由概念车的三门版",tokens: {
"tokens": [
...,
{
"token": "谍",
"start_offset": 10,
"end_offset": 11,
"type": "null",
"position": 4
},
{
"token": "照",
"start_offset": 11,
"end_offset": 12,
"type": "v",
"position": 5
},
{
"token": "表示",
"start_offset": 12,
"end_offset": 14,
"type": "v",
"position": 6
},
...
]
} "谍照表示",tokens: {
"tokens": [
{
"token": "谍",
"start_offset": 0,
"end_offset": 1,
"type": "null",
"position": 0
},
{
"token": "照",
"start_offset": 1,
"end_offset": 2,
"type": "v",
"position": 1
},
{
"token": "表示",
"start_offset": 2,
"end_offset": 4,
"type": "v",
"position": 2
}
]
} |
"谍照表示",是可以的 {
"query": {
"query_string": {
"query": "\"谍照表示\"",
"default_field": "title"
}
}
} |
这个,建议您看看,tokens和索引里的_termvectors |
@shi-yuan 谍照表符合"position": 6+"position": 7这两个连续的所以可以得到结果, 例如另外一个短句 |
使用index_ansj存储,query_ansj搜索 mapping简略配置如下:
搜索语句如下返回结果为空(搜索词加引号)
搜索词不加引号时正常。但返回结果数量很多。
但并不是所有词加引号都不会返回结果,比如"谍照曝光"等词可以正常返回。
我看了下默认词典好像词性只为n的词前后都不能加其他词去搜索,
比如"谍照表"词性为n,文章中原文是“本田Urban EV谍照表示其车型由概念车的三门版”。用"谍照表"可以搜索出结果,但"谍照表示"无法搜索到结果,但用"谍照表"+"示"或"谍照表"+"表示"两个词同时搜索都可以得到文章。
同样方法在5.5.0版本中可以搜索到结果,但这个版本没有单独定义搜索分词,全部使用的dic_ansj分词。mapping如下
我的表达能力有限,请大大多多理解给予帮助。谢谢
The text was updated successfully, but these errors were encountered: