如何使用FQL查询所有事件,而不使用标记为*的可索引列 [英] How could I use FQL to query all the events without using indexable column which is marked *

查看:168
本文介绍了如何使用FQL查询所有事件,而不使用标记为*的可索引列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题要解决。

我想查询所有的事件,我想查找特定的字符串。



FQL代码如下:



SELECT eid,name,location,start_time,end_time FROM event WHERE
strpos(lower (位置),'test')> = 0



当我使用这个FQL代码时,它总是发生错误。

错误消息是您的语句不可索引,WHERE子句必须包含可索引列。这些列在从 http://developers.facebook.com/docs/reference/fql



请给,我的意见点〜谢谢:)

解决方案

嗯,错误信息很清楚:


您的语句不可索引。
WHERE子句必须包含
可索引列。这些列是
标记为*在
中链接
http://developers.facebook.com/docs/reference/fql


所以只是你的方法不会工作。



编辑:

进一步解释为什么这不是可能:



Facebook处理超过<900万个对象(与网页,群组,活动和社区页面进行互动)。 参考



所以基本上给你(所有的App开发者)搜索所有页面,事件,组...等的能力肯定会带来系统下。这就是为什么仔细选择这些可索引字段的原因。



例如,如果要通过location搜索事件,那么这些事件应该与您的应用程序相关。像你的应用程序创建的,例如,你应该把它们的id存储在某个地方,以便像这样的工作:

  SELECT eid ,name,location,start_time,end_time FROM event WHERE 
strpos(lower(location),'test')> = 0 AND eid IN(ids_from_your_db)


I have a problem to solve.
I want to query all the events and I want to find the specific string.

The FQL code is like the following:

SELECT eid, name, location, start_time, end_time FROM event WHERE
strpos(lower(location),'test') >=0

When I used this FQL code,it always occurred error.
The error message is "Your statement is not indexable. The WHERE clause must contain an indexable column. Such columns are marked with * in the tables linked from http://developers.facebook.com/docs/reference/fql"

Please,give me your point of views~thank you :)

解决方案

Well, the error message is clear:

Your statement is not indexable. The WHERE clause must contain an indexable column. Such columns are marked with * in the tables linked from http://developers.facebook.com/docs/reference/fql

So simply your approach won't work.

EDIT:
To further explain why this is not possible:

Facebook deals with "over than 900 million objects that people interact with (pages, groups, events and community pages)". reference.

So basically giving you (all App devs) the ability to search ALL pages, events, groups...etc will definitely bring the system down. This is why these "indexible" fields are selected carefully.

For instance, if you want to search events by "location" then these events should be "somehow" related to your application. Like created by your App for example, and you should have their ids stored somewhere so that something like this would work:

SELECT eid, name, location, start_time, end_time FROM event WHERE
strpos(lower(location),'test') >=0 AND eid IN (ids_from_your_db)

这篇关于如何使用FQL查询所有事件,而不使用标记为*的可索引列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆