Как получить более 10 документов от Solr

0

Я новичок в 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
    или не требуется },jsonp: 'json.wrf'}); или нужно больше кода;
  • 0
    Можете ли вы уточнить, пожалуйста?
Показать ещё 2 комментария
Теги:
solr

1 ответ

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

Тогда это сработает

  • 0
    Спасибо, это сработало

Ещё вопросы

Сообщество Overcoder
Наверх
Меню