I've encountered an issue with integration with SuiteTalk API. We import some records (Inventory Items) with `search` call and subsequent `searchMoreWithId` calls. We provide conditions to `search` call and receive `search_id` in response. The search result may be large so we fetch every page of result with separate `searchMoreWithId` call specifying both `searchId` and `pageIndex`.
The issue is some calls of `searchMoreWithId` return empty list of records.
Example of such response with empty page:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Header> <platformMsgs:documentInfo xmlns:platformMsgs="urn:messages_2016_2.platform.webservices.netsuite.com"> <platformMsgs:nsId>WEBSERVICES...</platformMsgs:nsId> </platformMsgs:documentInfo> </soapenv:Header> <soapenv:Body> <searchMoreWithIdResponse xmlns="urn:messages_2016_2.platform.webservices.netsuite.com"> <platformCore:searchResult xmlns:platformCore="urn:core_2016_2.platform.webservices.netsuite.com"> <platformCore:status isSuccess="true"/> <platformCore:totalRecords>98852</platformCore:totalRecords> <platformCore:pageSize>10</platformCore:pageSize> <platformCore:totalPages>9886</platformCore:totalPages> <platformCore:pageIndex>66</platformCore:pageIndex> <platformCore:searchId>WEBSERVICES_...</platformCore:searchId> <platformCore:recordList/> </platformCore:searchResult> </searchMoreWithIdResponse> </soapenv:Body> </soapenv:Envelope>
Please notice `platformCore:recordList` XML tag in response document is empty.
I noticed a constant pattern - before empty pages there is not full one. E.g. we set page size = 10 and receive following records count in response:
page 1496 - 10 page 1497 - 5 page 1498 - 0 page 1499 - 0 page 1500 - 0 page 1501 - 10
I have found only following mentioning of decreasing page size in official documentation:
Consider the following possible issues when you execute a search in web services or SuiteScript that returns a large data set.If a record that originally fit the search criteria is updated and no longer fits the criteria, it is skipped by the search. In this case, some records that were originally included in the search results may not be returned, and the total number of returned records may be smaller than the original total number of results.If new records are created that fit the search criteria, they are also returned. The total number of returned records may be higher
after you page through the results than the original total number of
results, and duplicate results may be returned.Results may be missing. For example, if a record from the first results page is updated and it no longer fits the criteria, another
record now fits into page one. However, because earlier pages are
skipped when going through subsequent pages of search results, this
record is not returned.In web services, a greater or smaller number of records may be returned after you page through the search results than the number of records that originally fit the search criteria.Page two and the subsequent pages of the results set may contain fewer records than the specified page size.
But not sure whether it's related to our case.
So the questions: Is it a normal situation? Doesn't it require some additional handling or retrying?