5

Office 365 REST API for search return only 500 rows by setting parameter rowimit=500. This is the query i am trying..
https://server_address/_api/search/query?querytext='test'&rowlimit=500

but when i try to extend the limit to more than 500, I was getting following error enter image description here

Is there any way to extend the limit to more than 500 rows?
Where can we find the documentation for REST API for SharePoint search?

2 Answers 2

7

According to Search limits for SharePoint Online SharePoint Online search has the following limit:

Limit:     Number of rows in a result set
Maximum value:  500        
Limit type: Boundary(*)        
Notes: To display the entire result set, issue more paging queries

Boundary - A number that can’t be exceeded


Since 500 RowLimit cant be exceeded you could consider the following approach to return all search results. The idea is to perform queries until all search results will be returned, for that purpose we will utilize RowLimit and StartRow query parameters.

function search(webUrl,queryText,rowLimit,startRow,allResults)
{
    var allResults = allResults || [];
    var url = webUrl + "/_api/search/query?querytext='" + queryText + "'&rowlimit=" + rowLimit + "'&startrow=" + startRow;
    return $.getJSON(url).then(function(data) {
           var relevantResults = data.PrimaryQueryResult.RelevantResults;
           allResults = allResults.concat(relevantResults.Table.Rows);
           if (relevantResults.TotalRows > startRow + relevantResults.RowCount) {
               return search(webUrl,queryText,rowLimit,startRow+relevantResults.RowCount,allResults);
           }    
           return allResults;
    });
}

Usage

search(_spPageContextInfo.webAbsoluteUrl,'sharepoint',500,0)
  .done(function(results){
       for(var i = 0;i < results.length;i++){
           console.log(results[i].Cells[3].Value);
       }
   });

References

SharePoint Search REST API overview

0
0

There is no complete documentation for the REST API (AFAIK).

  1. Did you try it with 499?
  2. You could implement a paging (get the first 500 and then skip the first 500, etc)

The search query tool helps you creating those queries easily.

1
  • Thanks for response. I want to get more than 500 records without iteration. Do we have any option to get bulk amount of search rows?
    – Symbol
    Feb 23, 2015 at 11:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.