Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharepoint Search Query Tool Pagination of results #333

Open
ITMonkey78 opened this issue Aug 10, 2023 · 3 comments
Open

Sharepoint Search Query Tool Pagination of results #333

ITMonkey78 opened this issue Aug 10, 2023 · 3 comments

Comments

@ITMonkey78
Copy link

Sharepoint Search Query Tool v2.10.0
Results in the tool are limited to 500 regardless of row limit or rows per page entered. Pagination doesnt seen to work.
Is this a limitation of the REST query or is the tool not paginating the results correctly?

Case Scenario: I have almost 10000 sites to crawl. I'm trying to return a list of sites that an account has access to through the Everyone permission (instructions are on the Microsoft Support site here)

The query:
https://example.sharepoint.com/sites/Example_Site_SPO/_api/search/query?querytext='path%3ahttps%3a%2f%2fexample.sharepoint.com'&enableinterleaving=false&rowsperpage=500&rowlimit=500&clienttype='ContentSearchRegular'

My query returns
Elapsed Time (ms): 1355

Primary Query Results:
	Total Rows: 74631
	Total Rows Including Duplicates: 97912

But the Raw tab contains only an xml or json object with 500 entries and the Primary Results lists only 500

I can modify the Start position to skip the first 500 and collect the next 500, but for 10000 results this is not ideal.

@wobba
Copy link
Collaborator

wobba commented Aug 10, 2023

See https://learn.microsoft.com/en-us/sharepoint/dev/general-development/pagination-for-large-result-sets on how to use search to page large result sets. Or see https://www.techmikael.com/2023/08/how-to-paginate-large-results-sets-for.html to do the same using Graph API.

And page size is limited to 500, and has been for a long time.

@ITMonkey78
Copy link
Author

ITMonkey78 commented Aug 13, 2023 via email

@wobba
Copy link
Collaborator

wobba commented Aug 14, 2023

Happy to accept a PR for this and makes sense :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants