简体   繁体   English

正确使用STREAM表和filter_key facebook FQL查询

[英]Proper use of STREAM table and filter_key facebook FQL query

In the documentation it mention only AND and NOT. 在文档中,仅提及AND,而不提及。 The reason I'm trying to use OR is to break a large results sets into multiple queries and make sure the queries doesn't fail. 我尝试使用OR的原因是将大型结果集分成多个查询,并确保查询不会失败。

For example: This query return one result: 例如:此查询返回一个结果:

SELECT post_id FROM stream WHERE (source_id = '100000462790227' ) AND strpos(lower(message),'sweet') >=0 AND (filter_key = 'others') 从流中选择post_id(source_id ='100000462790227')AND strpos(lower(message),'sweet')> = 0 AND(filter_key ='others')

But when I added OR on the filter key I got empty results 但是,当我在过滤键上添加OR时,结果为空

SELECT post_id FROM stream WHERE (source_id = '100000462790227' ) AND strpos(lower(message),'sweet') >=0 AND (filter_key = 'others' OR filter_key = 'nf' ) 从流中选择post_id(source_id ='100000462790227')AND strpos(lower(message),'sweet')> = 0 AND(filter_key ='others'或filter_key ='nf')

Is it the OR, or do I do something else wrong? 是OR,还是我做错了其他事?

I finally understood what is the core issue. 我终于明白了什么是核心问题。 Stream table filter_key 'other' and 'owner' works only on one source_id. 流表filter_key“其他”和“所有者”仅对一个source_id起作用。 My original query had also OR on multiple source_id something like (source_id = '100000462790227' OR source_id = '12345670' ). 我的原始查询也对多个source_id进行了OR运算,例如(source_id ='100000462790227'OR source_id ='12345670')。

This combination return empty results!! 此组合返回空结果!!

Here are my conclusions and observations: 这是我的结论和观察结果:

First "OR" is supported by FQL. FQL支持第一个“ OR”。

One issue I saw "Graph API explorer" fails sometime while iOS SDK calls succeeded 在iOS SDK调用成功的同时,我看到“ Graph API Explorer”失败的一个问题

If you limit the call with " LIMIT X" where X is under 100 you'll get an answer also on the second query. 如果您使用X小于100的“ LIMIT X”限制通话,则第二个查询也会得到答案。 There are few posts on the issues related to large result set and what is the right limit (the one I read are all based on trial and error). 关于大型结果集以及正确的限制是什么的文章很少(我读过的文章都是基于反复试验的)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM