How to filter by category in FQL

五迷三道 提交于 2019-12-07 02:05:37

问题


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


回答1:


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.




回答2:


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




回答3:


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.



来源:https://stackoverflow.com/questions/5082627/how-to-filter-by-category-in-fql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!