```/** * @NApiVersion 2.x * @NScriptType MapRedu...
# suitescript
a
Copy code
/**
 * @NApiVersion 2.x
 * @NScriptType MapReduceScript
 */

define(['N/search'], function(search) {




    function getInputData() {
       
        var fulfillmentSearch=search.load({id: 'customsearch934'});

        var results=fulfillmentSearch.run().getRange(0,9000);
a
        log.debug('results ',results);

    }

  
    function map(context) {

    
    }

   
    function reduce(context) {


    }
    
    function summarize(context) {
        
    }

    return {
        getInputData: getInputData,
        map: map,
        reduce: reduce,
        summarize: summarize
    };});
{"type":"error.SuiteScriptError","name":"SSS_SEARCH_RESULT_LIMIT_EXCEEDED","message":"No more than 1000 search results may be requested at one time from nlobjSearchResultSet.getResults(). Please narrow your range, or use nlobjSearchResultSet.forEachResult() instead.","stack":
Encountered this error while retrieving results from saved search that has around 8000 rows , how do i get all the rows and process them in map reduce script
for your specific question, map/reduce scripts have specific mechanisms for handling search objects
a
Thanks sir . can i use scheduled script as well for these kind of tasks ? or map reduce script is better then other script types when a lot of data needs to be processed ?
b
you have to add rescheduling logic if there is a risk of running out of points in scheduled scripts
👍 1
map/reduce scripts force you to break up your data and process them in parts, in return, it handles that rescheduling logic
👍 1
a
Thanks 👍