Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Search 斯芬克斯最小搜索指数_Search_Sphinx - Fatal编程技术网

Search 斯芬克斯最小搜索指数

Search 斯芬克斯最小搜索指数,search,sphinx,Search,Sphinx,以下是我的sphinx搜索配置(sphinxsearch_0.9.9-6_amd64): } 我使用php作为客户端 $sphinx_client->SetServer('localhost', 9312); $sphinx_client->SetConnectTimeout(1); $sphinx_client->SetArrayResult(true); $sphinx_client->setRankingMode(SPH_RANK_WORDCOUNT); $sphi

以下是我的sphinx搜索配置(sphinxsearch_0.9.9-6_amd64):

}

我使用php作为客户端

$sphinx_client->SetServer('localhost', 9312);
$sphinx_client->SetConnectTimeout(1);
$sphinx_client->SetArrayResult(true);
$sphinx_client->setRankingMode(SPH_RANK_WORDCOUNT);
$sphinx_client->SetMatchMode(SPH_MATCH_EXTENDED2);
if ($mode == 'all') {
$sphinx_client->SetSortMode(SPH_SORT_RELEVANCE, 'category');
} else {
$sphinx_client->setFilter('category', array($this->_filter_category), FALSE);
}
$sphinx_client->SetLimits(0, $this->_limit);
$results = $sphinx_client->Query('"^'.$query.'$"', 'FULL');
例如,我在索引中有这些名称: 1.亚历克斯 2.阿伦 3.乔治 4.A. 5.G

::当我尝试搜索简单的1字符字符串“A”时,我得到了Alen/Alex/A等等

如何根据字符串长度进行搜索,以便以正确的顺序显示它们,如: A/阿伦/亚历克斯

我还得到了“警告:索引‘已满’:无词法,索引\u精确\u单词=1无效,忽略”

致意

使用序号字段(),进行正常搜索,但修改排序模式:切换到扩展模式,并使用类似$sphinx_client->SetSortMode(SPH_sort_extended,@weight desc,myordinal asc')的组合

searchd
{
    listen                  =       192.168.2.3
    log                     =       /var/log/sphinxsearch/searchd.log
    query_log               =       /var/log/sphinxsearch/query.log
    read_timeout            =       3
    client_timeout          =       60
    max_children            =       30
    pid_file                =       /var/run/searchd.pid
    max_matches             =       1000
    seamless_rotate         =       1
    preopen_indexes         =       0
    unlink_old              =       1
    mva_updates_pool        =       1M
    max_packet_size         =       8M
    max_filters             =       256
    max_filter_values       =       4096
}
$sphinx_client->SetServer('localhost', 9312);
$sphinx_client->SetConnectTimeout(1);
$sphinx_client->SetArrayResult(true);
$sphinx_client->setRankingMode(SPH_RANK_WORDCOUNT);
$sphinx_client->SetMatchMode(SPH_MATCH_EXTENDED2);
if ($mode == 'all') {
$sphinx_client->SetSortMode(SPH_SORT_RELEVANCE, 'category');
} else {
$sphinx_client->setFilter('category', array($this->_filter_category), FALSE);
}
$sphinx_client->SetLimits(0, $this->_limit);
$results = $sphinx_client->Query('"^'.$query.'$"', 'FULL');