处理 Sphinx 结果中的星号
我正在使用 Sphinx 来搜索 MySQL。
Sphinx 返回的搜索结果之一是 M*A*S*H
,如热门电视节目中所示。
我面临的问题是返回 M*A*S*H
几乎适用于任何使用 Sphinx 进行的查询。 我猜这是由于星号造成的。如果不是,那么问题可能是什么?
如果星号导致了我的问题,我该如何解决此问题,以免每次查询都返回 M*A*S*H
?
I'm using Sphinx to search MySQL.
One of the results Sphinx returns for a search is M*A*S*H
, as in the hit television show.
The problem I'm facing is that M*A*S*H
is returned for nearly any query made with Sphinx. I'm guessing this is due to the asterisks. If not, then what could the problem be?
If the asterisks are causing my problem, how can I work around this to not have M*A*S*H
returned for every query?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这个问题似乎不再存在,尽管我不知道为什么。我确信我的 sphinx.conf 中一定有问题。如果其他人有这个问题,请在这里告诉我,我会尝试相应地更新这个答案。
This problem no longer seems to exist, though I don't know why. I'm sure that something must have been amiss in my sphinx.conf. If someone else has this issue, let me know here and I'll try to update this answer accordingly.
在任何情况下,您都可以使用例外文件来指定您可能想要包含在搜索中的任何单词。每当更改文件时,请记住重新索引。
您可以在此处阅读详细信息: http://sphinxsearch.com/docs/1.10/conf-异常.html
In any case you can use the exceptions file to specify any word you may want to include in your searches. Remember to reindex whenever you change the file.
You can read the details here: http://sphinxsearch.com/docs/1.10/conf-exceptions.html
确保 charset_table 中包含星号。
http://sphinxsearch.com/docs/current.html#conf-charset-table
Make sure that asterisks are included in the charset_table.
http://sphinxsearch.com/docs/current.html#conf-charset-table
此 Sphinx 函数 (EscapeString) 是否执行您想要的操作
Does this Sphinx function (EscapeString) do what you want