Skip to content
This repository has been archived by the owner on Jul 18, 2018. It is now read-only.

该发行版里面同义词功能不work #48

Open
Steven-Z-Yang opened this issue Oct 19, 2016 · 2 comments
Open

该发行版里面同义词功能不work #48

Steven-Z-Yang opened this issue Oct 19, 2016 · 2 comments

Comments

@Steven-Z-Yang
Copy link

我使用官方指南来实验同义词功能结果,结果在rtf版本里面同义词功能不work,在正常的英文发行版里面没有任何问题。
测试路径:https://www.elastic.co/guide/en/elasticsearch/guide/current/using-synonyms.html

@medcl
Copy link
Owner

medcl commented Jan 5, 2017

麻烦测试过程发一下

@Steven-Z-Yang
Copy link
Author

Steven-Z-Yang commented Jan 6, 2017

就是按照官方给的路径:
第一步:PUT /my_index
{
"settings": {
"analysis": {
"filter": {
"my_synonym_filter": {
"type": "synonym",
"synonyms": [
"british,english",
"queen,monarch"
]
}
},
"analyzer": {
"my_synonyms": {
"tokenizer": "standard",
"filter": [
"lowercase",
"my_synonym_filter"
]
}
}
}
}
}
第二步:
GET /my_index/_analyze
{
"analyzer" : "my_synonyms",
"text" : "Elizabeth is the English queen"
}
官方的结果是:
Pos 1: (elizabeth)
Pos 2: (is)
Pos 3: (the)
Pos 4: (british,english)
Pos 5: (queen,monarch)

而rtf的分析结果是:
{
"tokens": [
{
"token": "elizabeth",
"start_offset": 0,
"end_offset": 9,
"type": "",
"position": 0
},
{
"token": "is",
"start_offset": 10,
"end_offset": 12,
"type": "",
"position": 1
},
{
"token": "the",
"start_offset": 13,
"end_offset": 16,
"type": "",
"position": 2
},
{
"token": "english",
"start_offset": 17,
"end_offset": 24,
"type": "",
"position": 3
},
{
"token": "queen",
"start_offset": 25,
"end_offset": 30,
"type": "",
"position": 4
}
]
}

明显english这个token没有加上同义词british,另一个也是

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants