FQL过滤用户表按名称

时间:2012-12-10 00:51:20

标签: facebook facebook-fql

FQL user Documentation中说有4个可索引字段(标有*):

  • 名称
  • third_party_id
  • UID
  • 用户名

但是当我执行query like this

SELECT uid
FROM user 
WHERE name = "Mark Zuckerberg"

我收到错误:

{
  "error": {
    "message": "Your statement is not indexable. The WHERE clause must contain 
                an indexable column. Such columns are marked with * in the 
                tables linked from 
                http://developers.facebook.com/docs/reference/fql ", 
    "type": "NoIndexFunctionException", 
    "code": 604
  }
}

我在这里缺少什么?这是一个错误吗?如何按名称过滤用户表上的FQL查询?

1 个答案:

答案 0 :(得分:3)

等待FB对此错误的回复,但同时有一个解决方法。

可索引列名称在配置文件表中工作,并且可以返回其id字段,该字段对应于用户表中的uid列,例如,

SELECT first_name FROM user WHERE uid IN (SELECT id FROM profile WHERE name="Mark Zuckerberg")