我将配置文件作为属性编写为 -:
sql_attr_float = rad_latitude
sql_attr_float = rad_longitude
但是在选择查询中,我得到的数据为
array(2) {
["rad_latitude"]=>
string(9) "-0.371600" //this needs to be float
["rad_longitude"]=>
string(9) "-0.878434" //this needs to be float
}
它以字符串形式出现,我无法计算 Geodist,因为它在字符串中。
Sphinxql 的 execute 函数以字符串形式返回数据,但您可以在 Geodist 查询中按原样使用它。 请记住不要在查询中的列名称上使用引号,如果您在它上面加上引号,Sphinx 会将其视为字符串,我不会产生任何结果。