I have wasted too much time over the last couple of days figuring out why my REST service will only return 32 entries….
Problem
This would seam like a simple search using the viewJSONService and I would expect in my case to see 198 results
<xe:restService id="marky" pathInfo="marky"> <xe:this.service> <xe:viewJsonService defaultColumns="true" viewName="ByName-First"> <xe:this.search><![CDATA["Avenue"]]></xe:this.search> </xe:viewJsonService> </xe:this.service> </xe:restService>
But I only get 32 – why???
Solution
Something simple, small and unassuming – searchMaxDocs. When it is not set the default is not All Matching Documents as I had assumed…
If you do NOT set searchMaxDocs to ZERO you will never get more than 32 documents in your search results.
<xe:restService id="marky" pathInfo="marky"> <xe:this.service> <xe:viewJsonService defaultColumns="true" viewName="ByName-First" searchMaxDocs="0"> <xe:this.search><![CDATA["Avenue"]]></xe:this.search> </xe:viewJsonService> </xe:this.service> </xe:restService>
Conclusion
The default number of results when searching a REST service is 32
Always set your searchMaxDocs=”0″
I spend a few hours on this too a few weeks back…. Another warning: If you ever use the xe:viewItemFileService and need a ‘categoryFilter’, then don’t use the ‘categoryFilter’ property. It will return an error 500. Instead, use the ‘keys’ property 😉
Nice,
I had simply been adding count=9999 on the end to return the whole set. Thanks for posting this.
Great tip
xem xe mercedes s500
Searching a REST service – when the default is not everything « Xomino