logo
search
Others

Why SharePoint Search REST API TotalRows Changes and How to Fix It

Algirdas JasaitisAlgirdas Jasaitis Oct 20, 2026 868 views

Question details

The user is seeking to understand why the TotalRows property in SharePoint Online Search REST API fluctuates for identical queries.

Why Does SharePoint Search REST API TotalRows Change?
Product
SharePoint Online Search REST API
Device & OS
not provided
Scenario
Custom SharePoint development using SPFx and React where exact search result counts are needed.
Observed behavior
The Search REST API returns varying TotalRows values for the same query, even without underlying data changes, and setting TrimDuplicates to false does not stabilize the count.
Before you start

Verify your query parameters and confirm that your SharePoint tenant's search index is not currently undergoing a background crawl or synchronization.

Solution 1Recommended

Consult the Microsoft Q&A Developer Community

Since this involves core SharePoint search engine estimation algorithms and custom SPFx/React development, reaching out to Microsoft engineers is the most effective approach.

The TotalRows value in SharePoint Search is generally an estimate optimized for performance rather than a strict count. Addressing complex scenarios around this behavior requires advanced developer support from Microsoft.

1
Navigate to Microsoft Q&A

Open your web browser and go to the official Microsoft Q&A forum at learn.microsoft.com/en-us/answers/questions/.

2
Sign in to your account

Log in using your Microsoft Developer or corporate Office 365 credentials.

3
Draft your question

Click the 'Ask a question' button. Clearly describe your SPFx and React setup, provide your REST API query structure, and mention that TrimDuplicates did not fix the TotalRows fluctuation.

4
Add the proper tags

Ensure you apply the 'SharePoint Development' tag to your post so that specialized Microsoft engineers and community experts can locate and address your query.

Consult the Microsoft Q&A Developer Community
Provide Query Details: Including your specific GET/POST request headers and body payload in the forum post will help experts diagnose the issue faster.
Free Microsoft Office alternative

Document Your Code Architectures with WPS Office

While resolving complex SharePoint REST API development issues, you need a reliable suite for documenting your code, queries, and project architectures. WPS Office provides a free, lightweight, and highly compatible alternative to Microsoft Office, ensuring seamless document management without heavy system overhead.

  1. 1. Visit the official website: Go to the official WPS Office website to access the latest version.
  2. 2. Download the installer: Click the 'Free Download' button tailored for your operating system.
  3. 3. Install the software: Run the downloaded installer and follow the on-screen instructions to complete the setup.
Fully compatible with Microsoft Word, Excel, and PowerPoint formats.Lightweight installation with blazing-fast launch speeds for rapid documentation.Familiar user interface for a zero-learning-curve transition.Ideal for drafting SPFx architecture documentation and API troubleshooting reports.
microsoft office alternative - wps office

Frequently Asked Questions

Why does TrimDuplicates=false not fix the TotalRows issue?

In SharePoint Search, TotalRows is designed as an estimate to maximize query performance across large datasets. Disabling TrimDuplicates reveals hidden duplicate items but does not override the fundamental estimation algorithms used by the search index.

Is TotalRows guaranteed to be accurate in SharePoint Online?

No. The SharePoint Search REST API typically provides an estimated TotalRows count. For queries returning massive result sets, calculating the absolute exact number of matching rows would drastically degrade performance, so an approximation is returned instead.

What is the best alternative to using TotalRows for exact counts?

If a precise count is strictly required for your React application, developers often need to page through the results iteratively or use specific CAML queries against targeted lists. However, note that these alternatives can be significantly slower than relying on the Search index.