Search for people by name in FQL

facebook, facebook-fql

Solution

later edit

Ok, sorry for the mistake regarding strpos, I didn't remeber it existence last time i checked the fql docs. The thing about it is that it can be used just in certain cases. You need to have a primar indexable column in your where clause and a second condition with strpos (at least this is how I succeded using it). For example:

SELECT actor_id, message FROM stream WHERE source_id = me() AND strpos(message, 'stuff') > 0 limit 50

I hope this clarifies a little bit the confusion with this function.

Problem

I'm trying to develop a search for people by name feature using the Facebook API. I'm trying this FQL query: ``` SELECT uid, username, name, pic_square FROM user WHERE strpos(name, 'Alfredo Artiles') >= 0 ``` But I get an "Your statement is not indexable. The WHERE clause must contain an indexable column." error. I also tried to add a "and uid > 0" condition, but that didn't work too. Any idea?

Original source