Enable Zing text indexing for a table to allow users to search its records for string values. Configure the table's text indexing attributes, stop words, and synonym dictionaries to control search behavior.

Before you begin

Role required: ts_admin or admin

About this task

Enabling text indexing for a table allows users to search for string values in records on that table. You can configure attributes, stop words, and synonym dictionaries to control indexing and search behavior for an indexed table.

By default, the system creates text indexes for the tables with a Text index record (All > System Definition > Text Indexes). For example:
  • Knowledge-related tables
  • Core-data-related tables
  • Connect-related tables
  • Task table
  • User table
Enabling text indexing for a table also enables it for all child tables. If you want to disable text indexing for a child table, see Remove the text index for a child table.
Note: Whenever you create an index table, the system also creates Access Control Roles (ACLs) for new tables.
Text indexing can be a resource-intensive task that may take a while to complete. You may notice performance degradation or incomplete search results during index generation. To estimate text indexing duration, you can view historical text indexing statistics.
Note:

New tables created by update set transfers have text indexing disabled, even if it's enabled for the tables included in the update set.

To enable users to search tables created by update set transfers, you must manually enable text indexing for those tables.

Procedure

  1. Navigate to All > System Definition > Text Index Configurations and select New.
  2. In Applies to, select Table.
  3. In Table, select the table that you want to configure text indexing for.
  4. (Optional) If you intend to use the table in multi-table searches or if you want to use the BM25 scoring algorithm on the table, upgrade its indexing format to V4.
    1. If the value in Format isn't grayed out, select v4, then select Submit and skip to step 5.
    2. If the value in Format is grayed out, select Submit.
      The grayed-out value means that the table has already been indexed and needs its indexing upgraded to V4.
    3. Navigate to All > System Definition > Text Index Configurations and select the table you submitted.
    4. Under Related Links, select Show index name record.
    5. Under Related Links, select Upgrade to V4 and select Submit.
      The specified table's indexing is upgraded from V3 to V4. Now, this table can be part of multiple-table indexing and BM25 is used to score the table's relevance score. Optionally, select Show Configuration under Related Linksto show the table indexing format on the Text Index Configuration page.
  5. Configure indexing and search attributes on the selected table.
    1. Navigate to All > System Definition > Text Index Configurations and select the table you configured.
    2. In the Text Index Table Attribute Maps related list, select New.
      Attributes pertain to the way Zing indexes documents and ranks documents returned in search results.
    3. On the Text Index Table Attribute Maps form, fill in the fields.
      Field Description
      Table Table to define attributes for.
      Attribute name Search engine attribute. For a list of the attributes and valid values, see Zing index and search attributes.
      Value Value for attribute.
    4. Repeat this procedure to define additional attributes for the table.
    5. In the Related Links section, select Generate Text Index.
  6. Configure column-level attributes.
    1. Navigate to All > System Definition > Text Index Configurations and select a table.
    2. In the Text Index Column Attribute Maps related list, select New.
    3. On the Text Index Column Attribute Map form, fill in the fields.
    4. Select Submit.
    5. Repeat this procedure to define additional search engine parameters for table columns in the index group.
    6. In the Related Links section, select Generate Text Index.
  7. (Optional) Add stop words.
    Stop words are words that you don't want to index, such as the, a, or an. There is a global list of common stop words, so you only have to add stop words specific to your situation. To see the global list of stop words, navigate in your browser to https://<instance name>.service-now.com/ts_stop_list.do.
    1. On the Index Stop Words tab, select New.
    2. In Index, select the index to add the stop word to.
    3. In Word, enter a single word you don't want to index and select Submit.
  8. (Optional) Add a synonym dictionary.
    Specifying a synonym dictionary searches on the search term as well as synonyms of the search term, such as car, and its synonym, auto. Zing provides a default synonym dictionary.
    1. On the Index synonym Dictionaries tab, select New.
    2. In Index, select the index to add the stop words to.
    3. In Synonym dictionary, select the synonym dictionary to use on the specified table.
      To add a dictionary, select New and follow the procedure in Create synonym dictionaries.

Result

The list search for text option appears on the list views for the table and its child tables.

What to do next

You can search records on the indexed table using list search in form view. To learn more about using list search, see List search finds records from the current table.

You can also query the indexed table for string matches using the GlideRecord.addQuery(name, value) or GlideRecord.addEncodedQuery(name, value) methods with the 123TEXTQUERY321 reserved name. For more information about querying for string matches, see Querying tables in script.

Fields excluded from text indexing

Text indexing excludes fields that meet certain name, type, attribute, or encryption conditions. User searches don't match or return values from excluded fields.

Text indexing excludes a field if it meets any of the conditions in the following table.