0
我正在嘗試使用sphinx的最新版本2.0.4爲我的網站構建搜索引擎。索引和發送查詢至今仍然有效。但我也想顯示一些方面,所以我會做兩次相同的查詢。第一個用於普通搜索結果,第二個用於某個屬性的分組。我的sphinx.conf看起來是這樣的:Sphinx + Group By返回「index rt:group-by屬性找不到」
{
...
sql_query = \
SELECT aID AS id, aFullname AS text, 'artist' AS type \
FROM artist
sql_attr_string = type
sql_ranged_throttle = 0
sql_query_info = SELECT * FROM artist WHERE aID=$id
}
source src2
{
...
sql_query = \
SELECT album_id AS id, album_name AS text, 'album' AS type \
FROM albums
sql_attr_string = type
sql_ranged_throttle = 0
sql_query_info = SELECT * FROM albums WHERE album_id=$id
}
index rt
{
type = rt
path = /var/data/rt
rt_field = text
rt_attr_uint = id
rt_attr_string = type
}
但是,當我使用第二個查詢與
$cl->SetGroupBy('type', SPH_GROUPBY_ATTR, '@count desc');
我得到這個錯誤:
WARNING: index rt: group-by attribute 'type' not found
任何人都可以發現一個錯誤在我的配置?