【问题标题】:Sphinx search for a part of word狮身人面像搜索单词的一部分
【发布时间】:2014-07-02 18:54:36
【问题描述】:

我安装了 SphinxSearch 并正确配置了它,在 CLI 中一切正常,也可以通过浏览器搜索。

我的问题是我只得到“整个单词”的结果,例如: 我想让所有单词都带有“pre”,例如“preconditions, presides”,所以当我输入 pre 时,我想我会得到前两个单词。

我对此进行了很多研究,也在这里发现了很多问题,但仍然得到相同的结果。

以下是我的配置文件的一部分:

index pbettingIndex
{
    source = src1
    path = /server/sphinx/data/src1Index
    docinfo = extern
    mlock = 0
    morphology = stem_en
    min_word_len = 1 
    charset_type = utf-8
    enable_star = 1

    #enable_wildcard = 1
    min_infix_len = 2
    #infix_fields = event_name
    #min_prefix_len = 1 
 } 

在我的 PHP 代码中,我尝试更改所有可用的匹配模式

$cl->SetMatchMode(SPH_MATCH_ANY); // etc...

【问题讨论】:

    标签: php search full-text-search sphinx


    【解决方案1】:

    要启用“星号”搜索,您必须调用

        $cl->query('*pre*', 'index');
    

    你也这样做了?

    文档:http://sphinxsearch.com/docs/archives/1.10/conf-enable-star.html

    【讨论】:

    • 老问题,但值得为其他人添加,使用 expand_keywords=1
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-04-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多