FQL isn't as powerful as SQL, and doesn't have access to selectors such LIKE
, but it does have built-in support for some basic functions, ones that make it possible to get similar results.
The basic functions available in FQL queries are now(), strpos(), substr()
, and strlen()
. Only the strpos()
function would actually be used in a text search it returns the position of one string, in another string. We can use this function to determine if the text we're looking for exists within the contents of a result's data field, and that's how we can power a simple FQL search.
In this recipe we're going to build an application which can search the status messages of the current user's friends, for occurrences of the text we supply.