How to retrieve page ids based on type using FQL? - facebook

I want to retrieve page ids of all those pages whose type is Musician/Band. I tried to retrive it from page table as
SELECT page_id from page where type='MUSICIAN/BAND'
but it is not allowing that.Its giving error:
Your statement is not indexable. The WHERE clause must contain an indexable column.
How to go about this?

You simply cannot do that query. You need to include at least one of the indexable columns in your query (page_id or name).

Related

Search facebook group using the name as a search term on Facebook FQL

I've tried using the Facebook Graph API. But the results came out, it did not show up to 150 groups. I'm not sure that it is a limitation of Facebook or not.
An example URL that I tested.
Now, I would like to test the FQL Query. But did not succeed. I have the following error
(#604) 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
This is a SQL statement
SELECT gid, name, privacy FROM group WHERE strpos(name, "programming") >= 0

Facebook FQL Searching Pages Using Partial String

I'm trying to search for a company's different branches using a partial string. Here's the query I'm using:
SELECT name, location, fan_count, talking_about_count, were_here_count
FROM page WHERE strpos(name, "Applebee's") >= 0 OR (name < 0)
I get the error:
Your statement is not indexable. The WHERE clause must contain an
indexable column.
Name is listed as indexable, so I'm not sure why this error is occurring.
You can use function CONTAINS():
SELECT name, location, fan_count, talking_about_count, were_here_count FROM page WHERE CONTAINS("Applebee's") and strpos(name, "Applebee's") >=0
This query will output all results which will contain Applebee's in name.

Facebook FQL. Table 'columns' contain wrong fields

Why the next Facebook FQL:
select column_name from columns where table_name = 'user' order by column_name
return are different list of columns then in api page http://developers.facebook.com/docs/reference/fql/user
for example it return field 'can_viewer_send_poke_message' but facebook tell that
(#602) can_viewer_send_poke_message is not a member of the user table
So, I just trying to automate process to keep some hql queries with full list of Columns of each hql table.
May be is there some other way to get for each table column list as string separated with ","?
This is a private field for Facebook Developers of the Official Poke Application for iPhone. It checks whether the users listed (friends) can use the poke application.

FQL like operator

Can someone tell me why this works:
SELECT name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=me()) AND strpos(lower(name),"jo") >=0
however this does not:
"SELECT url, id, type, site FROM object_url WHERE strpos(lower(url), 'sephora') >= 0"
When I put it in http://developers.facebook.com/docs/reference/rest/fql.query/
I get this response:
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
however "url" in indeed indexable.
any thoughts? I've already scoured stackoverflow but no answers found.
Site isn't indexable, it's only selectable. It doesn't have an * next to it here https://developers.facebook.com/docs/reference/fql/object_url/
you need to use url or id as the indexable column, so basically one of those needs to be in your where clause.
FQL != SQL You can't a a WHERE on any column you want. Not surprising considering the performance required with so many concurrent writers, I mean, one person in every ten in the world has signed up.
The problem in the second example is that a field used as a parameter in one of the string functions loses its indexability. It has to be the column itself.

Facebook FQL Query, searching on non-indexable item

I would like to generate a list of facebook user id's of people who are not in the United States. Rather than iterating through a list of user id's and checking each locale, I would like to do an FQL query. I attempted to execute this statement:
SELECT uid, name FROM user WHERE locale != "en_US"
However, when I make the query, I recieve the response:
(code 604): Your statement is not indexable.
This is because locale is not an indexable field. Do any of you know what I can do to get around this? Or perhaps another way of doing this entirely?
Thanks in advance!
It says "Your statement is not indexable." That means, you can't just use any query (like, extreme case, SELECT uid, name FROM user to get all facebook users) that does not conform. Only queries that include WHERE on fields that are indexable can be used. It's a policy, you can not circumvent it.