三人行必有我师

es分词奇葩问题

Elasticsearch | 作者 aa1356889 | 发布于2019年04月08日 | 阅读数:1569

1.mapping
{
"query":{
"match_phrase":{
"productName":{
"query":"纯生",
"slop":0
}
}
}
}
测试数据

{
"productName":"纯爽"
}
 

{
"productName":"纯生"
}
搜索2条都出来了
{
"query":{
"match_phrase":{
"productName":{
"query":"纯生",
"slop":0
}
}
}
}
纯爽分词结果
纯爽文档索引结果
{
"_index": "opcm3",
"_type": "doc",
"_id": "1",
"_version": 2,
"found": true,
"took": 5,
"term_vectors": {
"productName": {
"field_statistics": {
"sum_doc_freq": 4,
"doc_count": 1,
"sum_ttf": 4
},
"terms": {
"c": {
"term_freq": 1,
"tokens": [
{
"position": 0,
"start_offset": 0,
"end_offset": 2
}
]
},
"chun": {
"term_freq": 1,
"tokens": [
{
"position": 0,
"start_offset": 0,
"end_offset": 2
}
]
},
"s": {
"term_freq": 1,
"tokens": [
{
"position": 1,
"start_offset": 0,
"end_offset": 2
}
]
},
"shuang": {
"term_freq": 1,
"tokens": [
{
"position": 1,
"start_offset": 0,
"end_offset": 2
}
]
}
}
}
}
}
搜索索引情况
{
"valid": true,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
},
"explanations": [
{
"index": "opcm3",
"valid": true,
"explanation": "productName:\"(c chun) (s sheng)\""
}
]
}
已邀请:

aa1356889

赞同来自:

已解决

要回复问题请先登录注册