sphinx的 SPH_MATCH_PHRASE 模式怎么用啊

WBOY
Release: 2016-06-23 14:15:54
Original
1011 people have browsed it

sphinx的  SPH_MATCH_PHRASE 模式怎么用啊 他的query怎么写 
$cl->SetServer ( $host, $port );
$cl->SetMatchMode ( SPH_MATCH_PHRASE );
$cl->SetLimits ( 0, 20 );
$cl->SetWeights (array (10,1));
$res = $cl->Query ( 'dvd player', "search" );

我想查抄 dvd player 这个词 和 photo 这两个词 要怎么写啊  希望高手指点下啊 谢谢了


回复讨论(解决方案)

用SPH_MATCH_BOOLEAN
$res = $cl->Query ( 'dvd player & photo', "search" );

用SPH_MATCH_BOOLEAN
$res = $cl->Query ( 'dvd player & photo', "search" );
这个经过测试不行啊 

SPH_MATCH_PHRASE 将整个查询看作一个词组,要求按顺序完整匹配
SPH_MATCH_BOOLEAN 将查询看作一个布尔表达式
同一进程中只有第一个 SetMatchMode 生效

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template