2012-04-15 47 views
3

我想檢索一個有序(降序)的link_stats的結果集爲urls開始與一個共同的子字符串。我嘗試使用以下命令:Facebook的FQL爲有序link_stats

SELECT url, 
     normalized_url, 
     share_count, 
     like_count, 
     comment_count, 
     total_count, 
     commentsbox_count, 
     comments_fbid, 
     click_count 
FROM link_stat 
WHERE substr(url, 0, 22) = "http://www.example.com"; 

,但我不斷收到以下錯誤信息:

Your statement is not indexable. The WHERE clause must contain an indexable column. 

如何得到這個與額外的語法ALONG工作,命令由「降序任何意見total_count'將不勝感激。

謝謝!

+0

我開了一個[Facebook的錯誤(https://developers.facebook.com/bugs/638370562885875?browse=external_tasks_search_results_52b09083be1ed6d65674385)針對此問題。請鼓勵Facebook解決它。 :) – 2013-12-17 17:58:35

回答

1

url現在是可索引列。請參閱https://developers.facebook.com/docs/reference/fql/link_stat

您是否使用過直接where子句到url?

SELECT url, 
     normalized_url, 
     share_count, 
     like_count, 
     comment_count, 
     total_count, 
     commentsbox_count, 
     comments_fbid, 
     click_count 
FROM link_stat 
WHERE url = "www.example.com"; 
+0

Facebook的API文檔說,這個字段是可編入索引的,但它似乎並不是當你嘗試在查詢中使用它。 :( – 2013-12-17 17:59:22