I am trying to build an FQL query that returns post_id’s from a specific user to a Facebook group’s stream. I can query all posts and iterate through them and pull out what I need, but for a group with a lot of posts, it’s not feasible.
The FQL docs lead me to believe I need to use a filter_key in the WHERE clause because actor_id is not indexable. I can’t figure out how to use filter_key to get the results I am looking for.
SELECT post_id FROM stream WHERE target_id='a group_id' AND actor_id='a fb_id'
Any help is appreciated!
Here is the query you need:
For this, since you’re looking for posts in a group, the
GROUP_IDis yoursource_id. That is an indexable field. Once you have one indexable field in your WHERE clause, you can add additonal fields to it without a problem.Also, since
GROUP_IDandUSER_IDare integers, they don’t need to be quoted in FQL.