Skip to main content
Version: 1.23.3

SimpleSearch

This class provides methods that help the system to perform query searches in the tables specified by their IDs and reindex columns.

recreateAllIndiсes()


This method reindexes all columns with the active Full text search attribute in the system.

Return:

TypeDescription
VoidThis method does not return a value.

Example:

recreateAllIndices()
const simpleSearch = new SimpleSearch();
simpleSearch.recreateAllIndices();

recreateIndicesByTableName(tableName)


This method reindexes all columns with the active Full text search attribute within the table specified and its child tables.

Parameter(s):

NameTypeMandatoryDefault value
tableNameStringYN

Return:

TypeDescription
VoidThis method does not return a value.

Example:

recreateIndicesByTableName()
const simpleSearch = new SimpleSearch();
simpleSearch.recreateIndicesByTableName('task');

recreateIndicesByColumnId(columnId)


This method reindexes a column, including the values of child table records, based on its ID.

Parameter(s):

NameTypeMandatoryDefault value
columnIDStringYN

Return:

TypeDescription
VoidThis method does not return a value.

Example:

recreateIndicesByColumnId()
const simpleSearch = new SimpleSearch();
simpleSearch.recreateIndicesByColumnId(155931135900001085); // recreating indices for Description column of Task table

search(text, tableIDs)


Use this method to perform a search query against tables. The tableIDs parameter is an array of the ID type.

Parameter(s):

NameTypeMandatoryDefault value
textStringYN
tableIDsArray of StringsYN

Return:

TypeDescription
Array of ObjectsThis method returns an array of the SimpleRecord type.

Example:

recreateIndicesByColumnId()
const searchManager = new SimpleSearch();
const results = searchManager.search('email', ['155931135900000083'/* task */]);
results.map(foundRecord => {
ss.info(`/record/${foundRecord.getTableName()}/${foundRecord.sys_id}`);
});
//Info: /record/task/164579004293577819
//Info: /record/task/163696164398828017
//...