function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Madhura KurdukarMadhura Kurdukar 

How to retrieve more than 2000 records in SOSL query?

Hi,

I am using FIND query on KnowledgeArticleVersion object. The record limit of SOSL query is 2000. SO how to retrieve more than 2000 records? I am calling Salesorce SOAP API with the search query to retrieve records. 

Also in this query OFFSET is not working, 

Thanks
Thota Rakesh 1Thota Rakesh 1
Hi Madhura Kurdukar,

You are using SOAP APIs, where by default the max records returned are 500, which could be uplifted to 2000. Best would be to use "queryMore" to load the records. Here is a post from salesforce docs with good code samples for the same.

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_querymore.htm


Kindly mark it as solved if it helps you,


Best Regards,
Rakesh.T

 
Madhura KurdukarMadhura Kurdukar
Hi Rakesh,

Thanks for your reply. But I am using SOSL query and not SOQL.  
David StephanDavid Stephan
. Use querymore in the SOAP API, potentially with a cocoa library like zkSforce (https://github.com/superfell/zkSforce)
. Just use the nextRecordsURL endpoint you already have and issue a request for it