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

关于示例中name.pinyin搜索能直接搜中文英文 #278

Open
gaojingwei opened this issue Aug 31, 2022 · 1 comment
Open

关于示例中name.pinyin搜索能直接搜中文英文 #278

gaojingwei opened this issue Aug 31, 2022 · 1 comment

Comments

@gaojingwei
Copy link

第一个示例中“刘德华”,被pinyin_analyzer分词的结果里全都是拼音, 还有一个“刘德华”,但是用“刘”、"华"、“刘德”搜索name.pinyin字段都能搜到“刘德华”,这是为什么呀?“刘”、"华"、“刘德”这三个词都没有在分词结果里,理论上应该搜不到才对

@LiuFqiang
Copy link

示例使用指定分词器analyzer
{
"text": ["刘德华"],
"analyzer": "pinyin_analyzer"
}
因为包含了其他分词器,你可以换成field试试所以的分词结果都会出来
{
"text": ["刘德华"],
"field": "name.pinyin"
}

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

2 participants