【问题标题】:Sphinx don't match correct symbols狮身人面像不匹配正确的符号
【发布时间】:2013-01-24 06:42:07
【问题描述】:

我在使用 sphinx 搜索时遇到问题 例如查询是'C++'

对于这个查询,我得到匹配“C”的结果,但我需要 sphinx 来搜索精确的“C++”而不是“C”

【问题讨论】:

  • 我不确定 sphinx,但这可能是编码问题。例如 URL 中的+ 用于表示空格字符,因此您最好确保它们被正确编码/解码。

标签: php mysql search full-text-search sphinx


【解决方案1】:

检查您的charset_tablehttp://sphinxsearch.com/docs/current.html#conf-charset-table

怀疑你的charset_table 中没有 +,所以它没有被索引。

或者,如果您只想处理特定情况(例如 c++)而不是该字符的所有情况(例如 1+2),那么请考虑为 c++ 添加例外情况 http://sphinxsearch.com/docs/current.html#conf-exceptions (甚至在示例中!)

【讨论】:

    【解决方案2】:
    • 是算术字符,不会被匹配

    你应该看看这个问题的例外情况:

    http://sphinxsearch.com/docs/1.10/conf-exceptions.html

    C++ => cplusplus
    c++ => cplusplus
    

    【讨论】:

      猜你喜欢
      • 2011-07-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多