索引配置
index time(木耳草)
search time (mec)
搜索时mec被分词结果中出现me,使用phrase query检索时,检索不出来。有没有解决方案??
"analyzer": {
"pinyin_analyzer": {
"tokenizer": "my_pinyin"
}
}
"tokenizer": {
"my_pinyin": {
"lowercase": "true",
"keep_original": "false",
"keep_first_letter": "true",
"keep_separate_first_letter": "true",
"type": "pinyin",
"limit_first_letter_length": "64",
"keep_full_pinyin": "true"
}
"properties": {
"name": {
"type": "keyword",
"py": {
"type": "text",
"analyzer": "pinyin_analyzer",
"search_analyzer": "pinyin_analyzer"
}
}
}
index time(木耳草)
{
"tokens": [
{
"token": "m",
"start_offset": 0,
"end_offset": 0,
"type": "word",
"position": 0
},
{
"token": "mu",
"start_offset": 0,
"end_offset": 0,
"type": "word",
"position": 0
},
{
"token": "e",
"start_offset": 0,
"end_offset": 0,
"type": "word",
"position": 1
},
{
"token": "er",
"start_offset": 0,
"end_offset": 0,
"type": "word",
"position": 1
},
{
"token": "c",
"start_offset": 0,
"end_offset": 0,
"type": "word",
"position": 2
},
{
"token": "cao",
"start_offset": 0,
"end_offset": 0,
"type": "word",
"position": 2
},
{
"token": "mec",
"start_offset": 0,
"end_offset": 0,
"type": "word",
"position": 2
}
]}
search time (mec)
{
"tokens": [
{
"token": "me",
"start_offset": 0,
"end_offset": 0,
"type": "word",
"position": 0
},
{
"token": "c",
"start_offset": 0,
"end_offset": 0,
"type": "word",
"position": 1
},
{
"token": "mec",
"start_offset": 0,
"end_offset": 0,
"type": "word",
"position": 1
}
] }
搜索时mec被分词结果中出现me,使用phrase query检索时,检索不出来。有没有解决方案??
0 个回复