我是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索引的所有文档? 请帮帮我
答案 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'
});
然后它会起作用