Luis
11/02/2020, 2:31 PMEra
11/02/2020, 2:56 PMstalbert
11/02/2020, 3:07 PMLuis
11/02/2020, 3:19 PMLuis
11/02/2020, 3:19 PMLuis
11/02/2020, 3:20 PMstalbert
11/02/2020, 3:34 PMLazySearch.from(search.load(searchid1)).concat(LazySearch.from(search.load(searchid2))
. Without NFT you're going to need to create concatenated results more manually. You'll also have to consider the overall result set to determine of it fits into memory. If the total result size is small, building up an array in memory is one approach.Era
11/02/2020, 4:52 PM/**
* Searches all (>1000) results (CLASSIC - w/ runPaged)
*/
//var objSavedSearch1 = search.load({
// id: 'custsearch123'
//});
function searchAll(objSavedSearch1,objSavedSearch2) {
var maxSearchReturn = 1000; //(max no of results per page is 1000)
// Data
var arrReturnSearchResults = [];
var objPagedData1 = objSavedSearch1.runPaged({
pageSize: maxSearchReturn
});
objPagedData1.pageRanges.forEach(function(pageRange){
var objPage = objPagedData1.fetch({index: pageRange.index}).data;
arrReturnSearchResults = arrReturnSearchResults.concat(objPage);
});
var objPagedData2 = objSavedSearch2.runPaged({
pageSize: maxSearchReturn
});
objPagedData2.pageRanges.forEach(function(pageRange){
var objPage = objPagedData2.fetch({index: pageRange.index}).data;
arrReturnSearchResults = arrReturnSearchResults.concat(objPage);
});
return arrReturnSearchResults;
}
(of course, the memory limitation shall be considered...but I guess if you have only 3 columns, as you described, should be no problem to hold an array for 100k+ results)
hope it helpsLuis
11/06/2020, 3:03 PMJars
04/17/2021, 5:47 AMstalbert
04/17/2021, 3:31 PMrunPaged()
under the covers because that's what NS makes available. Note however that it executes lazily - i.e. only pulls subsequent pages of results as needed during processing.