3

I have a SharePoint 2013 site collection with a search center site. On the default search results page we can see two issues related to the no. of items in the results.

  1. On the first page of results there are 3 paging buttons ("1", "2" and "next button"). As we navigate to second and third (and so on) pages of the results, the paging button starts increasing. From a UI perspective this doesn't look good. The users prefer a consistent no. of paging buttons on all pages.
  2. The search count is inconstant and it varies its value across different results pages.

We believe both issues are related. We would like to confirm if these are really bugs (can see same even in Office 360) and if yes are there any confirmation from Microsoft? Does anyone know how can we fix these issues (at least the #1) without waiting for an official patch from Microsoft.

Screenshots below:

Page 1:

Page 1

Page 2:

Page 2

Page 3:

Page 3

2 Answers 2

3

This is by design and a lot of search engines do the same. Google does too for instance, but usually it gives you so many results that you'll won't notice.

The reason behind it is performance. The operation to exactly sum up the number of results is an expensive one which would add to the total amount of time required to return the result to the user (+ server load). For this reason, a lot of search engines return an estimate number of results instead.

When you move to a different page, the search engine re-estimates the number again and can return a different value. Usually, the higher the page number the better the estimate because the engine will have more knowledge about the actual results. At least that's my experience.

The result count is used to display the page numbers too, so for the same reason you might see less or more pages in between navigating those pages.

Not sure whether it always said this, but SharePoint Online these days says "About 370 results", which already indicates this is not an exact number.

Some more info here (for 2010 but still applies to my knowledge): http://blogs.msdn.com/b/sanjaynarang/archive/2009/02/20/handling-paging-and-total-results-count-in-sharepoint-custom-results-page.aspx

1

Check this post: https://spbreed.wordpress.com/2013/09/14/sharepoint-2013-solution-to-inconsistent-search-results-count/

It also installs the latest CU

3
  • Thanks for the info Christian. I did go through the article,The logic mentioned in the article is to persist "ctx.DataProvider.get_totalRows()" obtained in the first page and use it on every page. SharePoint is returning value of "ctx.DataProvider.get_totalRows()" differently on different pages and on the first page the value seems to be wrong (less than actual). So keeping that value constant across other pages is not a solution for me. I can see the same results in Office 365 site too, so I am not sure its fixed with any CU but definitely I will try that.
    – Arun
    Commented Aug 17, 2015 at 8:40
  • I found a similar workaround in the post http://moudhafersalhi.com/category/search/display-templates/ which can solve my issue from a UI perspective. But still I do not understand why search API is returning total number of rows differently on different pages.
    – Arun
    Commented Aug 19, 2015 at 12:11
  • Search results count is an estimate number. It's closer to correct value with each page you go. Using this workaround will cause the first value (which i potentially far off) to be persisted. Commented Sep 21, 2015 at 11:41

Your Answer

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

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