Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
642 views
in Technique[技术] by (71.8m points)

facebook - How could I use FQL to query all the events without using indexable column which is marked *

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...