我在 sphinx 2.0.5-id64-release (r3308) 上创建索引时遇到了奇怪的麻烦
/etc/sphinx/sphinx.conf
source keywords
{
// ..
sql_query = \
SELECT keywords.lid, keywords.keyword FROM keywords_sites \
LEFT JOIN keywords ON keywords_sites.kid = keywords.kid \
GROUP BY keywords_sites.kid \
sql_attr_uint = lid
sql_field_string = keyword
// ...
}
我收到警告
WARNING: attribute 'lid' not found - IGNORING
但是当我将查询更改为:
sql_query = \
SELECT 1, keywords.lid, keywords.keyword FROM keywords_sites \
LEFT JOIN keywords ON keywords_sites.kid = keywords.kid \
GROUP BY keywords_sites.kid \
我没有收到任何警告。为什么会这样?