HCL Compass Search for administrators

Administrators can use Compass Search feature to improve the existing full-text search capability.

Procedure

  1. Create a type-ahead configuration file called “typeahead_cfg.txt” with the following text in it:
    users=login_name,fullname,phone,email,misc_info

    This file can be placed anywhere on your file system. Its content will be copied over to your search home directory and used as the setting for your type-ahead configuration. For this example, we are enabling type-ahead on the filed “users” and we are using the listed fields as the search fields.

  2. Execute the “initSearch” command to initialize Compass search:
    cqperl cpsearch.pl initSearch -username admin -password "" -dbset SearchDemo -userdb SAMPL -searchHome D:\CPSearch\CPSearch.Home -solrHome D:\CPSearch\CPSolr.Home -solrPort 8984 -typeahead typeahead_cfg.txt

    This command assumes port 8984 is available and that the file “typeahead_cfg.txt” that you created in step #1 is in the current directory. Also, the paths for “searchHome” and “solrHome” do not need to exist, they will be created for you.

    If you are setting Compass Search on Linux, provide a valid path to where you want your search home to be, such as “-searchHome /opt/cpsearch/cpsearch.home” and “-solrHome /opt/cpsearch/cpsolr.home”.

  3. Edit the entity file to select which fields will be used as the display field. The entity file gets created and saved in your “searchHome” directory. For example,
    D:\CPSearch\CPSearch.Home\SearchDemo_SAMPL\Entity_SearchDemo_SAMPL.txt
    This file list all the record types and their fields that can be searched on. You will need to select a field for each record type that will be used as the display field. To do so, place “&” in front of that field. For example,
    Customer=…,Description,Email,Fax,&Name,Phone,is_active,…
    Defect=Attachments,Description,&Headline,Keywords,Note_Entry,…
    Email_Rule=…,From_Addr,Include_Defect,Is_Active_Rule,&Name,Operator_Value,…
    Project=Description,&Name,is_active,lock_version,locked_by,…
    groups=…,lock_version,locked_by,master_dbid,&name,ratl_keysite,ratl_mastership
    users=…,is_user_maint,lock_version,locked_by,&login_name,master_dbid,misc_info,…
    

    If you do not want to allow searching on a record type, simply delete that line from the file. If you do not want to allow searching on some fields for a record type, simply delete those fields from the record type.

  4. Execute the “deploySearch” command to complete your Compass Search deployment:
    cqperl cpsearch.pl deploySearch -username admin -password "" -dbset SearchDemo -userdb SAMPL -searchHome D:\CPSearch\CPSearch.Home

    This command takes only a few minutes to complete. It will read all records and fields that you enabled for Compass Search based on the list of record types and fields you selected in the entity file (see step #3 above) and send them to Solr for indexing.

  5. On Windows look for a Windows service called “cpsearchservice_searchdemo-sampl” and start it. On Linux, execute the “startSearchServer” command:
    cqperl cpsearch.pl startSearchServer -searchHome D:\CPSearch\CPSearch.Home -startAs continues

    This will start the incremental indexer which will query your Compass database looking for records that changed or records that were added or records that were deleted and update the Solr index to reflect those changes in your search result.

    Note that, on Windows, you can also execute the same command but if you do so, the indexer and Solr service will stop when you close the command shell or when you logoff.

    On Linux, you will need to make this command part of your OS start up by adding this command to your systemd, init or init.d.

Results

Compass Search is now ready. Logon to Compass from a Web browser and start using it. If you need to disable and archive Compass Search, run the “archiveSearch” command:

cqperl cpsearch.pl archiveSearch -username admin -password "" -dbset SearchDemo -userdb SAMPL -searchHome D:\CPSearch\CPSearch.Home

This command will disable Compass Search and rename both “searchHome” and “solrHome” directories. It will not delete any files.

Note that, before you run this command, you must stop the search service. On Windows, use the Windows services, and on Linux use stop the service.

For HCL Compass cpsearch.pl tool commands, see the HCL Compass command reference, the cpsearch.pl tool topic.