Adding record types to the search index

You can add record types to the full-text search index so that these record types are searchable.

Before you begin

This scenario requires some planning. For each record type that you add to the search index, you must decide which fields to index and the display field for the record type.

About this task

This scenario assumes that you have deployed full-text search on the SAMPL database as described in Enabling full-text search on the SAMPL database. You want to add one or more record types to the search index so that these record types are searchable.

This scenario should take approximately 10 minutes to complete because the SAMPL database has few records.

Procedure

  1. Edit the cqtsadmin-TextSearch-SAMPL.xml configuration file to add ChangeRequest as a record type to include in the full-text search index. Do this by changing the value of the <addRecordType> XML tag from this:
    <newValue required="no"></newValue>

    to this:

    <newValue required="no">ChangeRequest=Description,&amp;Headline,Keywords,Owner,Project,Team</newValue>

    Notice that &amp; is prepended to the Headline field. This is the XML encoding of the ampersand (&) character, which is used to select the display field for the record type.

  2. Optional: To add multiple record types, separate each with a semicolon (;). The next example also adds TestCase as a record type to include in the search index:
    <newValue required="no">ChangeRequest=Description,&amp;Headline,Keywords,Owner,Project,Team;TestCase=Description,&amp;Headline,Keywords,Owner,Project,Team</newValue>
  3. Run the cqtsadmin.pl command, with the add_record_type option, in a command prompt window.
    Important: In a production environment, be sure to back up your deployment before running the cqtsadmin.pl command with the add_record_type option. Run this command during off-peak hours because the operation can take a few minutes to a few days to complete, depending on the size of your database and number of records affected.

    cqperl cqtsadmin.pl --username admin --password secret --dbset TextSearch --userdb SAMPL --ftshome D:\CQ.Search --add_record_type

    Running the cqtsadmin.pl command with the add_record_type option is a stateful operation. If you stop the command or it stops because of an error, when you rerun the command, it resumes from where it left off and continues to completion.

  4. Edit the cqtsadmin-TextSearch-SAMPL.xml file again to remove the record types that you added to the <addRecordType> tag in Steps 1 and 2.

Results

You have added one or more record types to the search index. HCL Compass Web client users must log off and log on again to see the newly added record types in the search results.