FQL您的陈述无法建立索引,但可以在控制台中使用

编程入门 行业动态 更新时间:2024-10-25 01:27:38
本文介绍了FQL您的陈述无法建立索引,但可以在控制台中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用此查询进行FQL:

I'm using this query for FQL:

SELECT pid, object_id, caption, like_info, comment_info, src, src_small, src_big, images FROM photo WHERE album_object_id="10151088306597851" ORDER BY like_info DESC

在控制台中工作正常,请检查: developers.facebook /tools/explorer?method = GET& path = fql%3Fq%3DSELECT%20pid%2C%20object_id%2C%20caption%2C%20like_info%2C%20comment_info%2C%20src%2C%20Src_small%2C%20src_big%2C %20images%20FROM%20photo%20WHERE%20album_object_id%3D%2210151088306597851%22%20ORDER%20BY%20like_info%20DESC

which works fine in the console, check: developers.facebook/tools/explorer?method=GET&path=fql%3Fq%3DSELECT%20pid%2C%20object_id%2C%20caption%2C%20like_info%2C%20comment_info%2C%20src%2C%20src_small%2C%20src_big%2C%20images%20FROM%20photo%20WHERE%20album_object_id%3D%2210151088306597851%22%20ORDER%20BY%20like_info%20DESC

但是当我将Javascript SDK与FB.api()方法一起使用时,它将失败,并显示错误604您的语句不可索引.WHERE子句必须包含可索引的列.在从 developers.facebook/docs/reference/fql 但是根据表"photo"的文档,"album_object_id"是可索引的.

But when I use the Javascript SDK with FB.api() method it fails with 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 developers.facebook/docs/reference/fql" But according to the docs of table "photo" "album_object_id" IS indexable..

这是我的Javascript代码:

This is my Javascript code:

if (album_object_id) { var query = 'SELECT pid, object_id, caption, like_info, comment_info, src, src_small, src_big, images FROM photo WHERE album_object_id="' + album_object_id + '" ORDER BY like_info DESC'; //console.log(query);return; FB.api('/fql?q=' + encodeURI(query), callback); }

当我记录查询并将其复制/粘贴到图形API控制台时,它工作正常.

When I log query and copy/paste it into the graph API console, it works fine..

任何线索?

欢呼 舍尔德

推荐答案

我认为encodeURI在此语法上引入了查询编码问题.以下代码可以正常工作,并返回82个项目:

I think there is a query encoding issue introduced by encodeURI on this syntax. The following code works perfectly and returns 82 items:

var query = 'SELECT pid, object_id, caption, like_info, comment_info, src, src_small, src_big, images FROM photo WHERE album_object_id="10151088306597851" ORDER BY like_info DESC'; FB.api('/fql', {q: query}, function(r) { console.log(r) }); }

更多推荐

FQL您的陈述无法建立索引,但可以在控制台中使用

本文发布于:2023-11-09 22:54:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1573655.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:您的   控制台   索引   FQL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!