Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This class may be used to perform query searches in tables specified by their IDs. Use the SimpleSearch method methods in your client-side scripts.server-side scripts.


recreateAllIndiсes()


This method reindexes all columns with active Full Text Search attribute in the system.

Return:

Type

Description

VoidThis method does not return value.

Example:

Code Block
languagejs
titlesearch
linenumberstrue
const simpleSearch = new SimpleSearch();
simpleSearch.recreateAllIndices();

recreateIndicesByTableName(tableName)


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

Parameter(s):

Name

Type

Mandatory

Default Value

tableNameStringYN

Example:

Code Block
languagejs
titlesearch
linenumberstrue
const simpleSearch = new SimpleSearch();
simpleSearch.recreateIndicesByTableName('task');

recreateIndicesByColumnId(columnId)


This method reindexes a column and its child entities based on its ID.

Parameter(s):

Name

Type

Mandatory

Default Value

columnIDStringYN

Return:

Type

Description

VoidThis method does not return value.

Example:

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

search(text, tableIDs)


This method performs a search query (specified in the text argument) on tables (specified with the tablesIDs argument)query against tables. The tableIDs argument parameter is an array of the sys_id type.


Parameter(s):

NameTypeMandatoryDefault Value
textStringYN
tableIDsarray<sys_id>ArrayYN


Return:

TypeDescription
array<SimpleRecord>ArrayThis method returns an array of records of the SimpleRecord type.

Example:

Code Block
languagejs
titlesearch
linenumberstrue
varconst searchManager = new SimpleSearch();
const results = searchManager.search('some textemail', [155931135900000007, 155931135900000002, 156846521901231916]);'155931135900000083'/* task */]);
results.map(foundRecord => {
  ss.info(`/record/${foundRecord.getTableName()}/${foundRecord.sys_id}`);
});
//Info: /record/task/164579004293577819
//Info: /record/task/163696164398828017
//...


Table of Contents
absoluteUrltrue
classfixedPosition