开发者

How to filter by category in FQL

As you can see here,

Businesses have their category information: Local Business, Sport, Education.. etc. It is the field "category".

I would like to know, is there a way to filter businesses by their category and 开发者_如何转开发position with FQL? I haven't found how to do it. For instance: give me all the sports center in this circle (lat, lon, radius).

thanks


The "category" attribute in the "page" table is called "type". Here is a query to filter the logged-in user's "local business" likes:

SELECT page_id, name, description, type, pic, fan_count
FROM page
WHERE
   page_id IN (SELECT page_id FROM page_fan WHERE uid = me())
   AND Type = 'LOCAL BUSINESS'

Run Example


You can't retrieve pages by category.

The FQL Page table has a field called categories.

You can retrieve the category for a business with FQL like this:

SELECT categories FROM page WHERE page_id = PAGE_ID

where PAGE_ID is the page's Facebook id.

However, categories is not an indexable field. You can't ask for all business in New York which are Florists since "WHERE categories = florist" isn't allowed.


I have been looking for something and haven't found anything. It appears that only the graph api has the category information for a page.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜