Kinvey:Google Places位置查询setlimit(> 20)只返回20个结果

时间:2014-07-01 18:42:10

标签: android android-studio google-places-api mongodb-query kinvey

我已经让Kinvey的Google Places功能运行良好,唯一没有用的事实是,当我的实体被我的查询填充时,它只返回20个结果,即使我设置了Query.Setlimit( 100)和Query.setSkip(0)

我正在使用:

Android Studio 0.6.1

Kinvey-Android-Lib 2.6.14

Kinvey的Java-2.6.14

以下是代码段。

    Query qry = new Query(new MongoQueryFilter.MongoQueryFilterBuilder());
    qry.setLimit(50);
    qry.setSkip(0);
    qry.nearSphere("_geoloc", marker.getPosition().latitude,
                    marker.getPosition().longitude, 100);
    AsyncAppData<EventEntity> locs = kinveyclient.appData("locations",
    EventEntity.class);
    locs.get(qry, new KinveyListCallback<EventEntity>() {
        @Override
        public void onSuccess(EventEntity[] eventEntities) {
    ... 
            // code executes fine but eventEntities.length 
             always = 20 regardless of location, Limit or Skip
    }

我错过了什么吗?

1 个答案:

答案 0 :(得分:0)

我还没有使用Kinvey Library,但我从Google Places Api的个人经验中知道返回的结果默认只有20个结果。查看Kinvey Docs on Location,它指的是Google Places API

其中声明:

By default, each Nearby Search or Text Search returns up to 20 establishment results per query; however, each search can return as many as 60 results, split across three pages. If your search will return more than 20, then the search response will include an additional value — next_page_token.