如何从solr获取10个以上的文档

时间:2015-08-29 13:35:56

标签: angularjs solr

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

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索引的所有文档? 请帮帮我

1 个答案:

答案 0 :(得分:2)

您可以添加以下参数(开始):

 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'
               });

然后它会起作用