0
我搜索使用兩個指標在獅身人面像:爲什麼獅身人面像不返回屬性名稱?
#users
source users : lsParentSource
{
sql_query_range = SELECT MIN(idDetailToUsers), MAX(idDetailToUsers) FROM detailtousers
sql_query = SELECT idDetailToUsers as id, 1000 as type, UsersTypeAccount, idDetailToUsers, SpecializationName, DetailToUsersName, DetailToUsersPhoto, city, country FROM detailtousers join users ON users.idUsers = detailtousers.idDetailToUsers left join usersspecialization ON usersspecialization.UsersSpecializationIdUser = detailtousers.idDetailToUsers left join specializationtousers ON specializationtousers.idSpecialization = usersspecialization.UsersSpecializationIdSpecialization WHERE idDetailToUsers >= $start AND idDetailToUsers <= $end GROUP BY idDetailToUsers
sql_attr_uint = type
sql_attr_uint = idDetailToUsers
sql_attr_uint = UsersTypeAccount
sql_field_string = SpecializationName
sql_field_string = DetailToUsersName
sql_field_string = DetailToUsersPhoto
sql_attr_uint = city
sql_attr_uint = country
sql_query_info = SELECT idDetailToUsers, DetailToUsersName, UsersTypeAccount, SpecializationName, DetailToUsersPhoto, city, country \
FROM detailtousers WHERE idDetailToUsers = $id
sql_ranged_throttle = 0
}
#medical
source medical : lsParentSource
{
sql_query_range = SELECT MIN(idMedicalFacilities), MAX(idMedicalFacilities) FROM medicalfacilities
sql_query = SELECT idMedicalFacilities as id, 2000 as type, idMedicalFacilities, MedicalFacilitiesName, MedicalFacilitiesPhoto, city, country FROM medicalfacilities WHERE idMedicalFacilities >= $start AND idMedicalFacilities <= $end
sql_attr_uint = type
sql_attr_uint = MedicalFacilitiesIdUser
sql_attr_uint = idMedicalFacilities
sql_field_string = MedicalFacilitiesName
sql_field_string = MedicalFacilitiesPhoto
sql_attr_uint = city
sql_attr_uint = country
sql_query_info = SELECT MedicalFacilitiesIdUser, MedicalFacilitiesName, MedicalFacilitiesPhoto FROM medicalfacilities WHERE idMedicalFacilities = $id
sql_ranged_throttle = 0
}
如果使用索引users
只有它返回我的選擇查詢指定的所有屬性。 但是,如果使用兩個索引,獅身人面像不返回屬性。 什麼是原因?
結果爲指數users
:
array(1) {
[533]=>
array(2) {
["weight"]=>
int(1)
["attrs"]=>
array(0) {
}
}
}
結果爲指數medical
:
array(5) {
[451]=>
array(2) {
["weight"]=>
int(2)
["attrs"]=>
array(0) {
}
}
[444]=>
array(2) {
["weight"]=>
int(1)
["attrs"]=>
array(0) {
}
}
但是,當我在sphinx.conf中使用一個索引時,它會返回具有名稱和值的屬性,然後是什麼屬性? – FranceDePerost 2015-02-08 14:02:26
另外它必須返回至少一個帶有表名的屬性 – FranceDePerost 2015-02-08 15:14:24
您可能可以使用' - > setSelect('type');'但不能確定。 Sphinx真的希望多索引查詢使用相同的模式。 – barryhunter 2015-02-09 12:19:42