none
Confusing total row counts RRS feed

  • Question

  • Good morning,

    We have a two-staged SharePoint environment both with configured search services. I'm currently confused by the totalrows count. To give an example.
    Prod:

    query?querytext=%27and(e,%20%22isdocument%22:equals(%221%22))%27&startrow=0&rowlimit=100&rowsperpage=3&selectproperties=%27Title,Url,LastModifiedTime,write,Path,Description%27&sourceid=%2772e2dc8d%2Dc397%2D49b2%2Dbb9b%2Dbaf61f60dddc%27&enablefql=true&trimduplicates=false

    returns about 128.000 rows.
    Test:

    query?querytext=%27and(e,%20%22isdocument%22:equals(%221%22))%27&startrow=0&rowlimit=100&rowsperpage=3&selectproperties=%27Title,Url,LastModifiedTime,write,Path,Description%27&sourceid=%2757716011%2D036f%2D4f37%2D82fb%2Df6ff459e5a4e%27&enablefql=true&trimduplicates=false

    returns only 4 rows.

    Both result sources are configured the exact same way, all content sources are fully crawled (in both enviroments, test and prod).
    If I change the startrow in the second example, let's say to 100, I get a totalrows of about 103. Playing this game any further to startrow=1000 I get 1003 totalrows. With a changed rowsperpage of 300 I get 1200 totalrows.

    This is quite confusing and not wanted at all. Is there any limit I don't see in test environment which isn't configured in prod? I just want to get the complete amount of totalrows and not a mhm-maybe-I-guess-rowscount.

    Tuesday, August 20, 2019 9:13 AM

All replies

  • Hi Florian ,

    When you change the value of StartRow, you affect the final result, but only RowLimit will affect the result.

    You can delete this paragraph and retest it.

    You can refer to the code in the following article and remove this paragraph : keywordQuery.StartRow

    https://www.thesharepointguide.com/sharepoint-search-how-to-return-all-results/

    If the problem persists, you can test it in query text in search web part.

    Best regards

    Itch Sun


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Wednesday, August 21, 2019 9:04 AM
  • Hi Itch,

    thanks for your reply. I did it like you said and now I got back 11 rows in total, which is still far too little compared with the prod environment. I also tested the result source in a query builder. For some expressions I get only 11 elements in total back (which is a too little count) or I run into the 15s timeout:

    Any suggestions where else I can look? The timeout on farm-level search settings is already set to 120,90.

    Small addition: I went on and ran in both search center a query about all. In Prod environment I see on page one about 3.9mio results (which makes sense for the whole farm). In QA environment on the other hand the count increases only by skipping through the pages by 10 results. e.g. Page 1: 11 results, page 2: 21 results, page 3: 31 results, etc.
    • Edited by Florian Adler Thursday, August 22, 2019 6:23 AM adding some information
    Thursday, August 22, 2019 6:14 AM
  • Hi Florian,

    I'm not that familiar with search rest api.

    It's very difficult for any search engine to get the exact number of total results found as it's very time consuming scheme. So, most search engines (including MOSS) perform only an "estimate" to provide total number of results.

    You can see some of the instructions in the following article:

    https://blogs.msdn.microsoft.com/sanjaynarang/2009/02/20/handling-paging-and-total-results-count-in-sharepoint-custom-results-page/

    Best regards

    Itch Sun


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Friday, August 23, 2019 9:15 AM
  • Hi ,

    Has the problem been solved?

    If you think the replies are helpful to you, please remember to mark them as answers. It will help others who meet the similar question in this forum.

    If you have any questions, you can update them at any time.

    Best regards

    Itch Sun


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.


    Tuesday, August 27, 2019 9:43 AM
  • Hi,

    unfortunately the problem isn't solved. At least the search works wo the own search center (results are right, filtering works, etc.) but the total resultrows still just updates when paging. Maybe it depends on a slightly different farm configuration between PROD and QA environment; I don't know.

    If someone else got an idea where to take a look (even on database level would be fine for me), just let me know.

    Monday, September 2, 2019 5:33 AM
  • Hi Florian ,

    If you need more information, you can go to user voice and post about it. Or you can contact MS support team.

    If the issue is urgent to your business, it is recommended that you contact Microsoft Customer Support Services (CSS) via telephone so that a dedicated Support Professional can assist you in a more efficient manner. Please be advised that you might be charged for phone support service. Here are the Phone Support numbers of Customer Service Representative(CSR) for the different regions:

     • If you are located in US or Canada, please call 1-800-936-4900;

    • If you are located in India, please call 1-800-419-5666;

    • If you are located in other countries or regions, please go to the website (http://support.microsoft.com/select/?target=assistance ) by selecting the product and following the wizard to create a new Phone Service Request to Microsoft Phone Support team.

    Best regards

    Itch Sun


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Wednesday, September 4, 2019 8:21 AM
  • check this post: Use pagination with Sharepoint search API. Some time ago we also faced with pagination problem and solution was to use rowLimit only instead of rowsPerPage (and not both in the same query).

    Blog - http://sadomovalex.blogspot.com
    Dynamic CAML queries via C# - https://github.com/sadomovalex/camlex

    Monday, September 9, 2019 3:14 PM