我正在尝试在 opensearchserver (http://open-search-server.com) 中使用同义词功能。我创建了一个列表,例如 ipod、i-pod、i pod => ipod、i-pod、i pod 它不工作。谁能告诉我如何使它与opensearchserver一起工作。
问问题
402 次
1 回答
1
Here is the process to setup synonyms in OpenSearchServer.
- Create the synonym list in the tab panel /Schema/synonyms. One line per group of equivalent words separated by commas:
Example:
ipod,i pod,epod,e pod
opensearchserver,open search server
Setup the analyzers to use the synonym list.
- Go to the tab panel /Schema/Analyzers.
- Edit the analyzer which will handle the synonyms. If you use the default schema template you should edit the StandardAnalyzer. Here is a screenshot capture which show the correct setup. To be multi-term aware, we have to add a shingle filter to build group of words. the synonym filter.
Reindex your data.
You can now search for ipod, i-pod, epod, e-pod, and find any ipod!
Remark: I removed the dash version (i-pod) because when you use the StandardAnalyzer, the dash are already ignored.
于 2012-09-13T16:13:36.023 回答