Search code examples
facebookfacebook-graph-apifacebook-fqlfacebook-public-feed-api

Getting all events given a certain filter criteria on Facebook


I'm trying to get events in Facebook that have a certain phrase or description in them. I'd like to not have the results filtered or limited, as the phrase is fairly specific.

As an example, the phrase I'm looking for is "UMvC3" (short for Ultimate Marvel vs. Capcom 3).

That said, I could run an FQL query (and subsequently enrich with a call to the Graph API, like so):

select eid from event where contains("umvc3") and start_time >= now() 
order by update_time desc

This will give me upcoming events with "umvc3" in them as well as only ones occurring in the future (I'm not concerned with past events).

However, the selection is severely limited. For example, the following isn't returned in the search results:

https://www.facebook.com/events/595137740538545/

It clearly has "umvc3" in the description text.

I can perform a search using the Graph API, but that doesn't return the above result either. Additionally, I can't filter using the Graph API on the start_time or order the results in a manner where I can stop processing the result set once I get to a certain point.

Finally, there is the Public Feed API, which will give me the entire firehose (which isn't filterable, like Twitter's, unfortunately), so I'll have to filter in real-time, which could be near impossible.

That said, am I approaching this the wrong way, or is there no way to really get a comprehensive, exact set of results from the Facebook API for events?

Note: I'm using the access_token provided by the Graph Explorer in the tools section.


Solution

  • The description column of Event FQL table isn't indexable, thus the freestyle search on not indexable columns won't give any result.

    The results you see by running the query you suggested gives only events where the 'umvc3' is in the name column, which is indexable.

    The only option is to ask facebook for fulltext indexing this column which apparently won't happen. They surely won't open any column for using clause like 'LIKE' since the query execution will take a lot of time.

    And the answer from Facebook developer: https://stackoverflow.com/a/5824449/334522