为什么索引Sphinx返回空值的属性?

时间:2015-01-11 20:43:29

标签: sphinx

在我的配置中设置2索引。当我使用users_index时,我在PHP中获得带有值的输出属性。但是当使用相同的index medicalfacilities时,我只获得没有值的属性名称。

#medicalfacilities
source medicalfacilities : lsParentSource
{

    sql_query_range = SELECT MIN(idMedicalFacilities), MAX(idMedicalFacilities) FROM

medicalfacilities
    sql_range_step  = 128

    sql_query       = SELECT idMedicalFacilities * 10 + 1 as id, 2000 as type,

idmedicalfacilities, MedicalFacilitiesName, medicalfacilitiesiduser, medicalfacilitiessite,

medicalfacilitiesemail, medicalfacilitiesphoto FROM medicalfacilities WHERE

idMedicalFacilities>=$start AND idMedicalFacilities<=$end

    sql_attr_uint    = idmedicalfacilities
    sql_attr_uint     = type
    sql_attr_uint    = MedicalFacilitiesIdUser
    sql_field_string = MedicalFacilitiesSite
    sql_field_string = MedicalFacilitiesName
    sql_field_string = MedicalFacilitiesPhoto
    sql_field_string = MedicalFacilitiesEmail
    sql_query_info     = SELECT MedicalFacilitiesName, MedicalFacilitiesDescription \
                         FROM medicalfacilities WHERE idMedicalFacilities = ($id - 1) / 10

    # Время засыпания в миллисекундах (sleep) перед отправкой запросов серверу (может быть

полезно для разгрузки сервера базы данных)
    sql_ranged_throttle = 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
}

索引:

 index medicalfacilities {

        source = medicalfacilities

        path = /var/data/sphinx/medicalfacilities
        #enable_star = 1 
        charset_type        = utf-8
        html_strip = 1
        #morphology = stem_ru
        min_word_len = 3
        min_prefix_len = 3
        #min_infix_len = 3
    }

    index users_index {

        docinfo       = extern
        source = users
        path = /var/data/sphinx/users
        charset_type  = utf-8
        html_strip    = 1
        morphology    = stem_enru
        min_word_len            = 1
        min_prefix_len          = 0
        min_infix_len           = 1
        enable_star = 1
    }

对于索引users,返回带有值的属性,对于medicalfacilities - 则不是。为什么? 我为Sphinx使用PHP扩展。

0 个答案:

没有答案