在Sphinx 1.10-beta(r2420)上,如果我通过php API实现它,我得到:
[_error] => searchd error: index users: attribute 'latitude' can not be updated (must be
boolean, integer, timestamp, or MVA)
P.S。 我理解它所说的“必须是布尔,整数,时间戳或MVA”,但我是 想知道是否有办法做到这一点。
以下是一些代码:
require("../../database.php"); $uid = $_SESSION['uid']; $uid = 59; $SQL = "SELECT RADIANS(latitude) as latitude, RADIANS(longitude) as longitude, static_city, points AS rank, UNIX_TIMESTAMP(last_login) AS last_login FROM users"; $query = mysql_query($SQL) or die(mysql_error()); $record = mysql_fetch_assoc($query); foreach($record AS $key => $val){ $values[] = $val; $keys[] = $key; } require("sphinxapi.php"); $cl = new SphinxClient(); $cl->SetServer('10.0.100.17', 9313); $user = Array(); $user[$uid] = $values; $index = 'users'; $cl->UpdateAttributes($index, $keys, $user); print_r($cl);