1.mapping
{
"productName":"纯爽"
}
{
"productName":"纯生"
}
搜索2条都出来了
纯爽文档索引结果
{
"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)\""
}
]
}
1 个回复
aa1356889
赞同来自: