new Searcher(recordType, batchSize, lowerBound, searchFilters, searchColumns) → {Upserter}
Searcher Class
Parameters:
Name | Type | Description |
---|---|---|
recordType |
string | The string representing the record type |
batchSize |
string | The string representing the batch size |
lowerBound |
string | The string representing the lower bound internalid |
searchFilters |
array | The array containing search filter params |
searchColumns |
array | The array containing search column params |
- Source:
- search.js, line 1
Returns:
A new instance of Searcher
- Type
- Upserter
Methods
-
appendResults(resultsBlock) → {null}
-
Concatenates the given result set onto the result list
Parameters:
Name Type Description resultsBlock
Array The array containing a set of results from Netsuite - Source:
- search.js, line 327
Returns:
- Type
- null
-
buildFormulaSegment(field, comparison, value) → {String}
-
Generates a single comparison segment for a SQL formula
Parameters:
Name Type Description field
string The String repesenting the field comparison
string The String repesenting the comparison operator value
string The String repesenting the value - Source:
- search.js, line 113
Returns:
The string representing the SQL function- Type
- String
-
createSearchColumns() → {null}
-
Generates an nlobjSearchColumn for each set of params in rawSearchColumns and appends the generated filters to the search column list
- Source:
- search.js, line 172
Returns:
- Type
- null
-
createSearchFilters() → {null}
-
Iterates over `rawSearchFilters` calling generating an nlobjSearchFilter from each
- Source:
- search.js, line 60
Returns:
- Type
- null
-
executeSearch() → {null}
-
Loop to orchestrate the entire search process
- Source:
- search.js, line 228
Returns:
- Type
- null
-
extractLowerBound(resultsBlock) → {Number}
-
Retrieves the list of the last record from the given result set
Parameters:
Name Type Description resultsBlock
Array The array containing a set of results from Netsuite - Source:
- search.js, line 314
Returns:
The number representing the id of the last-fetched record- Type
- Number
-
generateFormula(formulaData) → {String}
-
Generates a SQL function filter from the given params
Parameters:
Name Type Description formulaData
object The object repesenting the formula params - Source:
- search.js, line 84
Returns:
The string representing the SQL function- Type
- String
-
generateLowerBoundFilter() → {null}
-
Generates an nlobjSearchFilter to start the search at the lower bound, then assigns that filter to the list of all filters
- Source:
- search.js, line 138
Returns:
- Type
- null
-
generateSortColumn() → {null}
-
Generates a search column to sort by internalid and appends it to the list of all search columns
- Source:
- search.js, line 188
Returns:
- Type
- null
-
getParams() → {object}
-
Generates a list of params given in the HTTP request
- Source:
- search.js, line 338
Returns:
The object representing the params from the HTTP request- Type
- object
-
getSearchColumnObject(searchColumnData) → {nlobjSearchColumn}
-
Generates an nlobjSearchColumn with the given params
Parameters:
Name Type Description searchColumnData
object The object representing the search column params - Source:
- search.js, line 202
Returns:
The generated search column- Type
- nlobjSearchColumn
-
getSearchFilterObject(searchFilterData) → {nlobjSearchFilter}
-
Generates an nlobjSearchFilter with the given params
Parameters:
Name Type Description searchFilterData
object The object representing the search filter params - Source:
- search.js, line 156
Returns:
The generated search filter- Type
- nlobjSearchFilter
-
getSearchResults() → {Array}
-
Fetches a new set of results from Netsuite and accumulates them onto the result list
- Source:
- search.js, line 283
Returns:
The array of results fetched from Netsuite- Type
- Array
-
isExecutionDone(resultsBlock) → {boolean}
-
Requests a block of results from Netsuite, updates the context and
Parameters:
Name Type Description resultsBlock
Array The array containing a set of results from Netsuite - Source:
- search.js, line 269
Returns:
The boolean representing successful completion- Type
- boolean
-
reply() → {object}
-
Generates a formatted reply containing the results of the search execution
- Source:
- search.js, line 355
Returns:
The object representing formatted reply- Type
- object
-
searchIteration() → {null}
-
Requests a block of results from Netsuite, updates the context and accumulates the results to the result list
- Source:
- search.js, line 249
Returns:
- Type
- null
-
setFormula(searchFilterObject, formulaString) → {String}
-
Assigns a given SQL formula to a search filter
Parameters:
Name Type Description searchFilterObject
nlobjSearchFilter An nlobjSearchFilter instance formulaString
string The String representing the SQL formula - Source:
- search.js, line 126
Returns:
The string representing the SQL function- Type
- String
-
setSortColumn(A) → {null}
-
Sets the sort mastering of the given column
Parameters:
Name Type Description A
nlobjSearchcolumn search column - Source:
- search.js, line 217
Returns:
- Type
- null
-
updateBoundAndFilter(resultsBlock) → {null}
-
Updates the context of the search iteration using the given result set
Parameters:
Name Type Description resultsBlock
Array The array containing a set of results from Netsuite - Source:
- search.js, line 300
Returns:
- Type
- null