{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":39513,"path":"platform-administration/search-administration/index-multiple-tables.md","title":"Configure a text index group to search across multiple tables","bundle":null,"doc_type":null,"release":"australia","body":"\n# Configure a text index group to search across multiple tables\n\nUpdate tables to the V4 indexing format and include them in a text index group to facilitate searching across multiple tables.\n\n## Before you begin\n\nRole required: ts\\_admin or admin\n\n## About this task\n\nText index groups enable you to index and search across multiple tables.\n\nPerforming searches across multiple tables requires normalizing the tables first so the relevance scores mean the same thing for all tables. V4 indexing provides that normalization. Zing uses the [Okapi BM25](https://en.wikipedia.org/wiki/Okapi_BM25) ranking function to calculate the relevancy score of search results.\n\nThe V4 table indexing format is optimized for documentation, such as knowledge base articles. You don't need to reindex tables that use this format when you change the value of an indexing attribute, such as the weight of a field. If you want to use the BM25 ranking function on a single table, you can convert it to the V4 format.\n\nTo enable search across multiple tables, you:\n\n1.  Configure all of your chosen tables to use the V4 index format if they don't already use it.\n\n    **Note:** In new instances, the Catalog Item \\[sc\\_cat\\_item\\], Knowledge \\[kb\\_knowledge\\], Social Q&amp;A Questions \\[kb\\_social\\_qa\\_question\\], and User \\[sys\\_user\\] tables use the V4 index format. If you upgrade your instance from a previous release, the indexing format of these tables remains the same as it was in the older release.\n\n2.  Add the tables to a text index group so they can be indexed and searched together.\n\n    **Note:** You can't add the Task \\[task\\] table or any tables that extend it to a text index group.\n\n\n## Procedure\n\n1.  Configure the tables that you want to include in multiple table searches to use the V4 index format.\n\n    **Note:** Upgrading from V3 to V4 is easy. Downgrading from V4 to V3 is more difficult and discouraged.\n\n    1.  Navigate to **All** &gt; **System Definition** &gt; **Text Index Configurations**.\n\n    2.  Open the record for the table that you want to upgrade to the V4 index format.\n\n    3.  If **Format** isn't disabled, select **V4**, select **Submit**, and then skip to step [2](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-administration/search-administration/index-multiple-tables.md).\n\n        You can choose index formatting in this step because no index exists for the table.\n\n    4.  If **Format** is disabled, select the **Show index name record** related link.\n\n        The disabled field means that an index already exists for the table and you must explicitly update the index format.\n\n        The Text Index page displays.\n\n    5.  Select the **Upgrade to V4** related link, then select **OK**.\n\n        The system schedules a task to upgrade the text index from V3 to V4, enabling this table to participate in multiple-table indexing.\n\n2.  Create a text index group that specifies the tables you want to index together so you can search them together.\n\n    1.  Navigate to **All** &gt; **System Definition** &gt; **Text Index Groups**.\n\n    2.  Select **New**.\n\n    3.  Enter the following field values:\n\n        |Field|Value|\n        |-----|-----|\n        |Label|Name for the group of tables that you want to index and search together.|\n        |Tables|List of tables that you want to include in the text index group.|\n\n        You can add tables formatted with V3 and V4 to text index groups. If you add V3 tables, the text index group remains inactive.\n\n    4.  Select **Submit**.\n\n3.  Configure the indexing and search attributes on tables in a text index group.\n\n    1.  Navigate to **All** &gt; **System Definition** &gt; **Text Index Configurations**.\n\n    2.  Select **New**.\n\n        The Text Index configuration form displays. If you already have a text index group in the list, skip to step [3.d](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-administration/search-administration/index-multiple-tables.md).\n\n    3.  In **Applies to**, select **Index Group**.\n\n    4.  In **Index group**, select the magnifying glass and select the text index group you created, then select **Submit**.\n\n        The only text index groups that display are the ones you have already created.\n\n        The Text Index Configuration table displays.\n\n    5.  Open the record for your text index group.\n\n    6.  On the **Text Index Table Attribute Maps** tab, select **New**.\n\n        The Text Index Table Attribute Map form displays. Attributes pertain to the way Zing indexes or searches individual tables in the text index group.\n\n    7.  In **Table**, select a table to define attributes for.\n\n        Only tables in the specified text index group and their child tables display.\n\n    8.  In **Attribute name**, select the magnifying glass and select an attribute.\n\n        To see the list of attributes, enter `ts_configuration_attribute.list` in the application navigator. For attribute definitions, see [Zing index and search attributes](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-administration/search-administration/index-attributes.md).\n\n    9.  In **Value** enter a value and select **Submit**.\n\n        Valid values depend on the attribute. For information on valid values, see [Zing index and search attributes](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-administration/search-administration/index-attributes.md).\n\n    10. Repeat this procedure to define additional search engine parameters for other tables in the text index group.\n\n    11. Under **Related Links**, select **Generate Text Index**.\n\n4.  Configure search parameters on individual table columns in the text index group.\n\n    1.  Navigate to **All** &gt; **System Definition** &gt; **Text Index Configurations**.\n\n    2.  Open the record for your text index group.\n\n    3.  On the **Text Index Column Attribute Maps** tab, select **New**.\n\n        The Text Index Column Attribute Map form displays. Attributes pertain to the way Zing indexes or searches individual table columns in the text index group.\n\n    4.  In **Table**, select a table to define attributes for.\n\n        Only tables in the text index group and their child tables display.\n\n    5.  In **Attribute name**, select a search engine parameter, enter a value for that parameter in **Value**, and select **Submit**.\n\n        To see the list of attributes, enter `ts_configuration_attribute.list` in the application navigator. For attribute definitions, see [Zing index and search attributes](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-administration/search-administration/index-attributes.md).\n\n    6.  In **Column**, specify the name of the column in the selected table you want to apply the search attribute to.\n\n    7.  In **Value**, specify the attribute's value that governs the search.\n\n    8.  Select **Submit**.\n\n    9.  Repeat this procedure to define additional search engine parameters for table columns in the text index group.\n\n    10. Under **Related Links**, select **Generate Text Index**.\n\n5.  Add a synonym dictionary.\n\n    Specifying a dictionary enables searches on the search term and synonyms of the search term, such as `car` and its synonym `auto`. Zing provides a default synonym dictionary.\n\n    1.  Navigate to **All** &gt; **System Definition** &gt; **Text Index Configurations**.\n\n    2.  Open the record for your text index group.\n\n    3.  On the **Index synonym Dictionaries** tab, select **New**.\n\n    4.  In **Index**, select the table index to add the stop words to.\n\n    5.  In **Synonym dictionary**, select the dictionary to use.\n\n        To add a dictionary, select **New** and follow the procedure in [Create synonym dictionaries](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-administration/search-administration/create-synonym-dictionaries.md).\n\n    6.  Select **Submit**.\n\n    7.  Under **Related Links**, select **Generate Text Index**.\n\n6.  Select **Update**.\n\n\n## What to do next\n\nYou can query the tables in the text index group for string matches using the `GlideRecord.addQuery(name, value)` or `GlideRecord.addEncodedQuery(name, value)` methods with the `123TEXTINDEXGROUP321` reserved name. For more information about querying text index groups for string matches, see [Querying tables in script](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/api-reference/scripts/c_UsingGlideRecordToQueryTables.md).\n\n**Parent Topic:**[Zing indexes words](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-administration/search-administration/zing-indexes-words.md)\n\n**Related topics**  \n\n\n[Zing indexes punctuation as part of some words]()\n\n[Zing indexes some HTML elements]()\n\n[Configure a table for indexing and searching]()\n\n[Zing index and search dictionary attributes]()\n\n[Regenerate a text index for a table]()\n\n[Remove an index]()\n\n[Remove an index for a specific field]()\n\n[Remove the text index for a child table]()\n\n[Change the query mode of an indexed table]()\n\n[Enable indexing of text in multi-row variable sets]()\n\n[Text indexing statistics and status]()\n\n[Configure tables to use the Japanese tokenizer]()\n\n"}}