Content Search Web Parts (CSWPs) and Search Result Web Parts (SRWPs, a.k.a Result Script Web Parts RSWPs) prevent more than 50 results being returned at once. This is true with or without paging enabled. This is true even if you provision the web part using XML. In older versions of SharePoint, it may allow you to enter a row limit greater than 50 but will then default to a mere 10 results.
I’m sure Microsoft has very good UX and technical reasons behind this limitation, however at 100 items I don’t feel that either UX nor performance suffer. I imagine that if using this technique for returning large page sizes (>100) that there is very real potential for bad performance and the UX is most likely appalling.
Importantly – this code should only be considered a learning tool. This code is entirely unsupported and generally just a really bad idea. Please be responsible 🙂
Recognition to Matt Stark who provided this solution. All I have done is rewritten it a bit for safety and I wanted to prefix it with a bit more discussion than it had. Original discussion is here.
The web parts which you want to act upon must be set to load asynchronously (this is not the default mode).
Edit Web Part > Change Query > Settings > Loading Behaviour :: Async option
Take note:
- There are a few available solutions to this, none of which are much good, and even this one is should be considered a hack and be treated with caution.
- I will only discuss this option as it is the best I have come across when considering the limitations of SharePoint Online.
- Please only include this code on specific pages using a Content Editor or a Script Editor, and NOT globally.
- I have amended the original code such that it only changes the row limit for those web parts which are set to return 50 items exactly.
- I haven’t found any issues with this code, however I am using on a page that does nothing but display a list and in a situation where failure has limited impact on the system.
- Apparently doesn’t work for anonymous users
And finally the code…
Paul.
I am using Search core results webpart and used the code above in content editor. It still displays only 50 results. Please help!
Ensure that the web part is set to async mode as mentioned. Ensure that the Content Editor is higher on the page than the Results web part. That’s about all the advice I can give, you’ll have to debug it.
Legendary! thanks for the post
Worked great! Thanks!! Has anyone come across any issues with using this so far?
I actually found an issue when using this as a refiner. The refiner works originally, but when you click a refiner it errors out. Any ideas?
Hi Bro, Is it works on SharePoint online?
Yes, but please we aware of the risks involved as per my statement above “Importantly – this code should only be considered a learning tool. This code is entirely unsupported and generally just a really bad idea. Please be responsible”
Thank you so much for this workaround! Spent several days trying to solve this!!
SharePoint Online does not come with Content Editor or Script Editor web parts. Any other suggestions?