4

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 :)

solar
  • 335
  • 2
  • 6
  • 13

1 Answers1

6

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)
ifaour
  • 38,035
  • 12
  • 72
  • 79
  • Yes~I know,if I want to find some events which contains specific string and the index uid is unstable.I want to find a solution to solve this problem. – solar Apr 29 '11 at 00:58