Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要为我的朋友提供一个搜索选项。如果我使用“我/朋友”,它将列出我所有的朋友。如果我使用“search?q=keyword”,我会得到包含非好友的搜索结果。
他们是一种搜索 FB 用户的方式,我的朋友是谁?
可能最简单的方法是通过 FQL 使用如下代码:
SELECT name, about_me FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) AND ( strpos(lower(name), lower([SEARCH])) >= 0 OR strpos(lower(about_me), lower([SEARCH])) >= 0 )