sphinx.conf から:
source src0 {
type = pgsql
sql_host = localhost
sql_user = <db user>
sql_pass = <pwd>
sql_db = <db name>
sql_port = 5432
sql_query = \
SELECT id, header, text, "app_main" as table_name \
FROM app_main
sql_query_info = SELECT * FROM app_main WHERE id=$id
sql_attr_string = table_name
}
source src1 {
type = pgsql
sql_host = localhost
sql_user = <db user>
sql_pass = <pwd>
sql_db = <db name>
sql_port = 5432
sql_query = \
SELECT id, header, text, "app_product" as table_name \
FROM app_product
sql_query_info = SELECT * FROM app_product WHERE id=$id
sql_attr_string = table_name
}
index global_index {
source = src0
source = src1
path = D:/blizzard/Projects/Python/Web/moz455/app/sphinx/data/global_index
docinfo = extern
charset_type = utf-8
}
指示
client.Query(S, '*')
戻り値
{'status': 0, 'matches': [{'id': 5, 'weight': 30, 'attrs': {}}], 'fields': ['header', 'text'], 'time': '0.000', 'total_found': 1, 'warning': '', 'attrs': [], 'words': [{'docs': 1, 'hits': 2, 'word': 'styless'}], 'error': '', 'total': 1})
attrs dict が空なのはなぜですか? これはテーブル名を取得する正しい方法ですか?そうでない場合は何ですか?