狮身人面像切割符号
我有一个音乐收藏,并使用 sphinx 在其中进行搜索。搜索模式是 SPH_MATCH_PHRASE,但是当我搜索“B'Day”专辑时,sphinx 会剪切“'”并按“Day”查询进行搜索。如何强制 sphinx 按精确短语进行搜索而不过滤任何符号?
I have a music collection and use sphinx for searching in it. Search mode is SPH_MATCH_PHRASE, but when I search f.e. for "B'Day" album - sphinx cuts "'" and searching by "Day" query. How can I force sphinx to search by exact phrase without filtering any symbols?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要确保 sphinx 将 char ' 视为单词字符。
为此,您需要在 charset_table 中指定单词字符列表,
例如:
之后您需要重建索引并重新启动 searchd。
请参阅 http://www.sphinxsearch.com/docs/current.html #conf-字符集表
You need to make sure that char ' is treated by sphinx as a word character.
In order to do this, you need to specify the list of word characters in charset_table
For example:
After that you'll need to rebuild the index and restart searchd.
See http://www.sphinxsearch.com/docs/current.html#conf-charset-table
我在索引配置中设置了 param min_word_len = 1 并且效果很好!
I set param min_word_len = 1 in index config and it works well!