我正在尝试获取自动提示w.r.t. SetFilterFloatRange()Geodist,但它没有给我结果。
以下是我的代码
$cl = new SphinxClient();
$cl->SetServer('127.0.0.1', 9312);
$cl->SetMatchMode(SPH_MATCH_EXTENDED2);
$cl->SetLimits(0, 10);
$cl->SetGeoAnchor('latitude', 'longitude', (float)deg2rad(32.799) , (float)deg2rad(-86.8073));
$cl->SetGroupBy('alias_seq', SPH_GROUPBY_ATTR, 'priority DESC', '@geodist ASC');
$cl->SetFilterFloatRange('@geodist', 0.0, 100000); //This line causing issue
$partialQueryStr = " @keyword $query*";
$cnt = 0;
foreach ($neighbours as $key => $value) {
if(($cnt + 1) == count($neighbours))
{
$partialQueryStr .= " @geohash $value*";
}
else
{
$partialQueryStr .= " @geohash $value* | ";
}
$cnt++;
}
$cl->AddQuery($partialQueryStr, 'indexer');
$result = $cl->RunQueries();
Sphinx源代码
sql_query = //...simple SELECT query fetch below attributes
sql_attr_uint = sphinxid
sql_attr_uint = seq
sql_attr_uint = alias_seq
sql_field_string = keyword
sql_field_string = txt
sql_field_string = analyzed_object
sql_attr_uint = priority
sql_field_string = type
sql_field_string = geohash
sql_attr_uint = latitude
sql_attr_uint = longitude
使用SetFilterFloatRange得到0结果,
没有SetFilterFloatRange获得结果