Thank you for your feedback.
Form temporarily unavailable. Please try again or contact docfeedback@servicenow.com to submit your comments.

Configure multiple tables for indexing and searching

Log in to subscribe to topics and get notified when content changes.

Configure multiple tables for indexing and searching

Update tables to the V4 indexing format to include them in multiple table searches.

Before you begin

Role required: admin, ts_admin

About this task

Performing searches across multiple tables requires normalizing the tables first so the relevance scores mean the same thing for all of the tables. V4 indexing provides that normalization. Zing uses the Okapi BM25 ranking function to calculate the relevancy score of search results.

The V4 table indexing format is optimized for documentation, such as knowledge base articles. Tables that use the V4 indexing format do not need to be re-indexed when you change the value of an indexing attribute, such as the weight of a field.

You can also convert just a single table to the V4 format if you want to use the BM25 ranking function on it.

To understand searching across multiple tables at a high level, you:
  1. Configure tables to use V4 and add them to an index group.
    Note: For new ServiceNow instances, the following tables use the V4 index format: sc_cat_item, kb_knowledge, kb_social_qa_question, sys_user. If you upgrade from a previous version of ServiceNow, the indexing format of these tables remains the same as it was in the older version.
  2. Perform the search using glideRecord.addQuery(name, value), or glideRecord.addEncodedQuery(value) where name is the special value 123TEXTINDEXGROUP321. For more information about searching, see Querying tables in script.

Procedure

  1. Configure the tables you want to use in multiple table searches to use the V4 index format.
    1. Navigate to System Definition and click Text Index Configurations.
      The Text Index Configuration page displays.
    2. In Applies to select Table and select a table in the Table field.
    3. If Format is not grayed out, select V4, click Submit, and skip to step 2.
      This table was not indexed previously, so you can choose the index formatting in this step.
    4. If Format is grayed out, the table has already been indexed and you must explicitly update the index formatting. Click Submit.
    5. Navigate to Text Index Configurations and click <table-you-just-submitted>.
      The Text Index Configuration page displays.
    6. Under Related Links, click Show index name record.
      The Text Index page displays.
    7. Under Related Links, click Upgrade to V4.
      The specified table's indexing is upgraded from V3 to V4. Now, this table can be part of multiple-table indexing.
    8. Under Related Links , click Show Configuration to show the table indexing format in the Text Index Configuration form.
      Note: Upgrading from V3 to V4 is easy. Downgrading from V4 to V3 is more difficult and discouraged.
  2. Create an index group that specifies all of the tables to index together so they can be searched together.
    1. Click Text Index Groups.
      The Text Index Group form displays.
    2. In Label, enter a name for the group of tables to be indexed and searched together.
    3. In Tables, click the unlock icon and use the magnifying glass to add tables to the index group.
      Tables formatted with V3 and V4 can be added to index groups. If you add V3 tables, the index group will be inactive.
    4. If the Active field is unselected, make the index group active by clicking Activate Index Group under Related links.
      Activating the index group re-indexes all non-V4-formatted tables to V4.
    5. Click Submit.
      You created a collection of V4-formatted tables that can be indexed and searched together.
  3. Configure the indexing and search attributes on tables in an index group.
    1. Navigate to Text Index Configurations and click New.
      The Text Index configuration form displays. If you already have an index group in the list, skip to step d.
    2. In Applies to, select Index Group.
    3. In Index group, click the magnifying glass and select the index group you created and click Submit.
      The only index groups that display are the ones you have already created.
      The Text Index configuration form displays.
    4. Click your index group.
    5. On the Text Index Table Attribute Maps tab, click New.
      The Text Index Table Attribute Map displays. Attributes either pertain to the way Zing indexes or searches tables.
    6. In Table, select a table to define attributes for.
      Only tables in the specified index group and their child tables display.
    7. In Attribute name, click the magnifying glass and select an attribute.
      For a list of the attributes, enter <my-ServiceNow-instance>/ts_configuration_attribute_list.do. For definitions of the attributes, see Zing index and search attributes.
    8. In Value enter a value and click Submit.
      Valid values depend on the attribute. For information on valid values, see Zing index and search attributes.
    9. Repeat this procedure to define additional search engine parameters for table in the index group.
    10. Under Related Links, click Generate Text Index.
  4. Configure search parameters on individual table columns in the index group.
    1. Click Text Index Configurations > <my-group-index>.
    2. On the Text Index Column Attribute Maps tab, click New.
      The Text Index Column Attribute Map form displays.
    3. In Table, select a table to define attributes for.
      Only tables in the index group and their child tables display.
    4. In Attribute name, select a search engine parameter, enter a value for that parameter in Value, and click Submit.
      For a list of the attributes, enter <my-ServiceNow-instance>/ts_configuration_attribute_list.do. For definitions of the attributes, see Zing index and search attributes.
    5. In Column, specify the name of the column in the selected table you want to apply the search attribute to.
    6. In Value, specify the attribute's value that governs the search.
    7. Click Submit.
    8. Repeat this procedure to define additional search engine parameters for table columns in the index group.
    9. Under Related Links, click Generate Text Index.
  5. (Optional) Add a synonym dictionary.
    Specifying a dictionary enables to search on the search term and 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, click New.
    2. In Index, select the index to add the stop words to.
    3. In Synonym dictionary, select the dictionary to use.
      To add a dictionary, click New and follow the procedure in Create synonym dictionaries.

What to do next

Perform the search using glideRecord.addQuery(name, value), or glideRecord.addEncodedQuery(value). For more information about searching, see Querying tables in script.
Feedback