【问题标题】:SphinxQL - Sphinx search for a part of wordSphinxQL - Sphinx 搜索单词的一部分
【发布时间】:2015-08-02 06:38:26
【问题描述】:

我当前的 Sphinx 配置只返回匹配整个单词的结果,但我希望 sphinx 也返回搜索部分单词。

例如 如果我搜索单词 堵塞 它应该返回包含所有单词的结果,其中包含单词块,而不仅仅是 exat 匹配。 例如 大片 大片 大块

它类似于在查询中使用 block

我当前的 SPhinxQL 查询如下所示

SELECT id FROM disk_index1 WHERE MATCH('block') LIMIT 0,25 OPTION max_matches = 10000 

我已经尝试过回答 参考:searching in a part of word with Sphinx

  enable_star=1

但是 现在贬值了。 我什至尝试过像这样运行查询

SELECT id FROM disk_index1 WHERE MATCH('*block*') LIMIT 0,25 OPTION max_matches = 10000 

但它仍然不返回部分单词匹配

如何启用部分单词匹配?在 SPhinxQL 中?

Sphinx 服务器版本:2.2.9-id64-release (rel22-r5006) 在美分操作系统上 7 x 64

我当前的索引配置有

docinfo                 = extern
morphology              = stem_en
enable_star = 1

【问题讨论】:

    标签: php sphinx


    【解决方案1】:

    您可以使用min_infix_len 和min_prefix_len 来实现:

    中缀长度设置允许使用术语模式进行通配符搜索,例如 “开始*”、“*结束”、“*中间*”等。它还可以让您禁用 短通配符(如果搜索成本太高)。

    阅读更多关于Sphinx Search current documentation。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-09
      • 1970-01-01
      • 1970-01-01
      • 2017-08-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多