2014-12-04 31 views
1

我是新的獅身人面像,我想看看technology_core中有什麼,因爲我的查詢沒有返回應該是什麼。事實上,甚至在db中查詢這兩個結果。如何通過思考sphinx來調試索引數據

Processing by TechnologiesController#index as JS 
    Parameters: {"utf8"=>"✓", "filter"=>{"tech_type"=>["1"], "area_of_interest"=>["4"]}, "query"=>"", "_"=>"1417734808773"} 
    Sphinx Query (1.4ms) SELECT *, groupby() AS sphinx_internal_group, id AS sphinx_document_id, count(DISTINCT sphinx_document_id) AS sphinx_internal_count FROM `technology_core` WHERE `tag_id` IN (1, 4) AND `sphinx_deleted` = 0 GROUP BY `technology_id` HAVING COUNT(*)=2 LIMIT 0, 20 
    Sphinx Found 2 results 
    Rendered collection (0.0ms) 
    Rendered technologies/index.js.erb (2.7ms) 
Completed 200 OK in 15ms (Views: 12.7ms | ActiveRecord: 0.0ms) 

我雖然數據存儲到一個新的數據庫表,但有沒有創建一個technology_core表。然後我記得有一個db/sphinx文件夾,所以我猜索引的數據必須存儲在那裏。
有沒有辦法查詢該表technology_core

回答

2

您可以通過mysql命令行工具連接到獅身人面像:

mysql --host 127.0.0.1 --port 9306 

然後運行SphinxQL查詢(這是相似但不相同的SQL - 的Sphinx Query線在你的日誌是一個SphinxQL查詢)。 Sphinx docs覆蓋的語法非常好。

值得注意的是,SphinxQL查詢將返回所有屬性值(除非您只在SELECT子句中請求某些屬性),但它們不會返回字段。

相關問題