首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何从solr获取10多个文档

如何从solr获取10多个文档
EN

Stack Overflow用户
提问于 2015-08-29 13:35:56
回答 1查看 650关注 0票数 0

我是solr新手,我有一个solr应用程序正在运行,并开始从角应用程序中查询它,我从solr中获得了结果,但是我只得到了头10个文档,但是还有更多的文档索引了我的代码:

代码语言:javascript
运行
复制
angular.element.ajax({
               url: "http://localhost:8983/solr/food/select",
               data: {
                   "q": $scope.searchString,
                   "wt": "json"

               },
               traditional: true,
               cache: true,
               async: true,
               dataType: 'jsonp',
               success: function (data) {
                   //and when we get the query back we
                   //stick the results in the scope
                   $scope.$apply(function () {
                       $scope.results = data.response.docs;
                       console.log("result from solr is  ",$scope.results)

                   });
               }                        });
               },
               jsonp: 'json.wrf'
           }); 

如何从solr中获得所有文档的索引??请帮帮我

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-08-29 13:43:47

您可以添加以下参数(、start、rows):

代码语言:javascript
运行
复制
 angular.element.ajax({
                   url: "http://localhost:8983/solr/food/select",
                   data: {
                       "q": $scope.searchString, 
                       "start":10,//starting from this index
                        "rows":20,//count of results 
                       "wt": "json"

                   },
                   traditional: true,
                   cache: true,
                   async: true,
                   dataType: 'jsonp',
                   success: function (data) {
                       //and when we get the query back we
                       //stick the results in the scope
                       $scope.$apply(function () {
                           $scope.results = data.response.docs;
                           console.log("result from solr is  ",$scope.results)

                       });
                   }                        });
                   },
                   jsonp: 'json.wrf'
               });

然后它就能工作了

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32286643

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档