SharePoint Search REST API returns inconsistent Total Rows Count

Copper Contributor

Hello Everyone,


We are a building a custom web part with pagination feature. To implement feature we are getting Total rows count and showing possible number of pages.


While implementing we are running queries using startRow and rowLimit query string parameters. When I change the startRow TotalRows attribute returning different number for the same queryText.


Example:'test'&startrow=0&rowLimit=10 returns TotalRows 125'test'&startrow=10&rowLimit=10 returns TotalRows 112


But TotalRowsInclusingDuplicates property returns consistent value. However, If I try to use start row above the TotalRows count then getting 0 results.


I am wondering why Rows Count is varies by StartRow.


Is anyone facing same issue or any suggestions is very much appreciated.



Venkat Konjeti


1 Reply

@Venkat Konjeti Hi, this is by design when you use duplicate trimming, as trimming the full result set is time consuming, so it will re-calculate as you are paging.

My personal opinion is that you should turn off duplicate trimming as it's too coarse ( Append &trimduplicates=false and you should be good to go.


As a side not, if you get very many results, then the exact count might also be off, due to the query returning within a timeout interval.