I would like to allow users in my app to search for people they are not friends with by name.
I understand I can do a public search for users using this query:
search?q=mark&type=user
This gives me ALL users with the name mark
and isn't very relevant to the user.
I use this to search users they are friends with by name:
fql?q=
SELECT uid, name, pic_square
FROM user
WHERE strpos(lower(name),lower('mark')) >=0 AND
uid IN (SELECT uid2 FROM friend WHERE uid1 = me())
I'd be content allowing users to search their friends of friends using something like this:
fql?q=
SELECT uid, name, pic_square
FROM user
WHERE strpos(lower(name),lower('mark')) >=0 AND
uid IN (SELECT uid2
FROM friend
WHERE uid1 IN (SELECT uid2
FROM friend
WHERE uid1 = me()))
but unfortunately that returns the following error:
{
"message": "(#604) Can't lookup all friends of #####.
Can only lookup for the logged in user or the logged in user's friends that
are users of your app.",
"type": "OAuthException",
"code": 604
}
I understand this error. It looks like I'm going to have to use the public search.
How could I do a public search for all users affiliated with university XXX with a name containing 'mark'?
or does anyone have any alternatives to filter a public search by something relevant to a specific user?