title: SuiteScript 2.0: Are there any search result limitations when executing a saved search via "getInputData" stage of map/reduce script?
body: <p>I am currently building a map/reduce script in NetSuite which passes the results of a saved search from the getInputData stage to the map stage. This is being done by first running a WHILE loop in the getInputData stage to obtain the internal ids of each entry, inserting into an array, then passing over to the map stage. Like so:</p>
  <pre><code>           // run saved search - unlimited rows from saved search.
          do {
              var subresults = invoiceSearch.run().getRange({  start: start,  end: start + pageSize  });
              results = results.concat(subresults);
              count = subresults.length;
              start += pageSize + 1;
          } while (count == pageSize);
          
          var invSearchArray = [];
          
          if(invoiceSearch){
              //NOTE: .run().each has a limit of 4,000 results, hence the do-while loop above.
              for (var i = 0; i &lt; results.length; i++){ 
                  var invObj = new Object();
                  invObj['invID'] = results[i].getValue({name: 'internalid'}); 
                  invSearchArray.push(invObj);
              }
          }
  
          return invSearchArray;
  </code></pre>
  <p>I implemented it this way because I feared there would be result restrictions, just as the &quot;.run().each&quot; function has (limited to 4000 results).</p>
  <p>I made the assumption that passing the search object directly from getInputData to Map would have restricted results of 4000 as well. Can someone offer clarity on whether there are such restrictions? Am I right to fear the script holting prematurely because search results cannot be processed beyond 4000 in the getInputData stage of a map/reduce script?</p>
  <p>Any example to aid me in understanding how a search object is processed in a map/reduce script would be most appreciated.</p>
  <p>Thanks</p>