狮身人面像切割符号

发布于 2024-08-22 07:46:46 字数 132 浏览 4 评论 0原文

我有一个音乐收藏,并使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

仅一夜美梦 2024-08-29 07:46:46

您需要确保 sphinx 将 char ' 视为单词字符。

为此,您需要在 charset_table 中指定单词字符列表,

例如:

# treats all english characters and ' as word characters 
charset_table = 0..9, A..Z->a..z, _, a..z,'

之后您需要重建索引并重新启动 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:

# treats all english characters and ' as word characters 
charset_table = 0..9, A..Z->a..z, _, a..z,'

After that you'll need to rebuild the index and restart searchd.

See http://www.sphinxsearch.com/docs/current.html#conf-charset-table

放血 2024-08-29 07:46:46

我在索引配置中设置了 param min_word_len = 1 并且效果很好!

I set param min_word_len = 1 in index config and it works well!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文