Creating or updating Search services for a database schema

Learn how to use the HCL Compass Helm chart to create or update Search services for a database schema.

The Search services are created based on the database schemas configuration. For each schema, you must create and enable a search service.
  • The hcl-compass helm chart default setting enables the hcl-compass-search-app1 service for the DefectTracking schema and a user database named SAMPL. The settings for the hcl-compass-search-app1 service are defined under the hcl-compass.searchapp1 key in the values.yaml file.
  • The hcl-compass helm chart default setting also enables the hcl-compass-search-app2 service for the EssentialSAFe schema and a user database named SAMPL. The settings for the hcl-compass-search-app2 service are defined under the hcl-compass.searchapp2 key in the values.yaml file. The hcl-compass-search-app2 service is set to disable by default.
Updating existing search services
You can update existing search services as you need. Each Search setting is defined with the following format in the values.yaml file:
  searchapp#:                         # You can set "#" as a value 1 to N.
    service: <true/false>             # You can enable or disable the search service by setting to true or false.
    hostname: <host_name>             # Host name of the docker container runs the Search feature
    configSet: (“-username <Username> -password <User password> -dbset <dbset_name> -userdb <User database> -searchPort <search_port_number>”)
    ports: 
        - <search_port>               # Search port number
    db:                               # Database connection setting
      connectionSet: ("-v <db_vendor> -d <db_name> -s <db_server> -u <user> -p <password> -dbset <dbset_name>")
    properties:
      update:false
      valueSet: (\"-IndexWorkspace [true/false] -MaxHeapSize [val] -RetryAttempts [val] -RetryAttemptsPause [val] -IncrIndexMaxHeapSize [val] -FullIndexMaxHeapSize [val] -ProcRetryAttempts [val] -ProcRetryAttemptsPause [val]\")

The db.connectionSet should be based on your database connections. If you are using Oracle database for <db_vendor>, then -co <connect_options> is optional and will be needed when you define the connection options specific to your environment for Oracle database.

You must update the hcl-compass-search-app1 and, if it applies to your configuration, the hcl-compass-search-app2 service configuration setting based on your database schema and user database.

You can update hcl-compass-search-app1 or hcl-compass-search-app2 to configure for more than one search feature by configuring multiple database connections, search configsets and ports:
  searchapp#:
    db:
      connectionSet: ("connection-1" "connection-2" ..... "connection-n")
    configSet: ("configSet-1" ("configSet-2" ..... ("configSet-n")
    ports:
      - port-1
      - port-2
        .....
        .....
      - port-n
Updating the default Search Properties values
The full text search feature is installed with default properties values and it sets the CPSolr.MaxHeapSize, CPTool.IncrIndexMaxHeapSize, and CPTool.FullIndexMaxHeapSize values to 4096. If you need to update those default properties values (for example, in searchapp1, set searchapp1.properties.update to true and set your updated properties values in searchapp1.properties.valueSet.
## Database settings
## Compass search configuration settings for searchapp1 (DefectTracking).
  searchapp1:
    properties:
      update: true
      valueSet: (\"-IndexWorkspace [true/false] -MaxHeapSize [val] -RetryAttempts [val] -RetryAttemptsPause [val] -IncrIndexMaxHeapSize [val] -FullIndexMaxHeapSize [val] -ProcRetryAttempts [val] -ProcRetryAttemptsPause [val]\")
Disabling the hcl-compass-search-app1 service
Set the value for hcl-compass-search-app1 to false.
        searchapp1:
          service: false
Enabling the hcl-compass-search-app2 service
Set the value for hcl-compass-search-app2 to true.
         searchapp2:
          service: true
          db:                               #Database connection setting
            connectionSet: "-v <db_vendor> -d <db_name> -s <db_server> -u <user> -p <password> -dbset <dbset_name>"
Add a new database connection to the db.connectionSet:
"-v <db_vendor> -d <db_name> -s <db_server> -u <user> -p <password> -dbset <dbset_name>"

If you are using Oracle database for <db_vendor>, then -co <connect_options> is optional and will be needed when you define the connection options specific to your environment.

Binding the Search configuration entity and type-ahead files to the Pods for Search Configuration
To use new search data entity and type-ahead files during the search configuration, use the following instructions to bind your search data entity and type-ahead files to the pod container. The hcl-compass helm chart will configure the search based on your new search data entity and type-ahead files.
  1. Create a new folder /path/to/your/search_config:
    $ mkdir /path/to/your/search_config
  2. Copy your search data entity file based on Entity_<dbset_name>_<User_database>.txt file format and search configuration type-ahead file based on TypeAhead_<dbset_name>_<User_database>.txt file name format, where the <dbset_name> is the name of the database connection and <User_database> is the database name to the */path/to/your/search_config folder.
    $ cp Entity_<dbset_name>_<User_database>.txt /path/to/your/search_config/.  
    $ cp TypeAhead_<dbset_name>_<User_database>.txt /path/to/your/search_config/.  
  3. Add all search data entity files from the */path/to/your/search_config folder to confiMap file named search-config-file.
    $ kubectl create cm search-config-file --from-file=/path/to/your/search_config/
  4. Check to ensure that the confiMap search-config-file is created and that it has the search configuration entity and type-ahead files that are contained in */path/to/your/search_config.
    $ kubectl get cm search-config-file -o yaml
  5. Create search_config_file.yaml. Set the value true to enable the new Search configuration entity and type-ahead files to the pods and set the name of confiMap to search-config-file.
    search:
      configFile:
        enabled: true
        configMapName: search-config-file
  6. Add -f search_config_file.yaml to the helm install or helm upgrade command.
If you require more than one search service and database connections, you can update the hcl-compass helm chart to add the new search application services and new database connection data. The following example illustrates when two database connections exist with two search services for each database connection. In this case, one is for the Defect Tracking schema, and the other is for the EssentialSAFe schema. You can create a new values .yaml file called db_values.yaml.
  1. Create db.yaml and paste the following.
## Compass Database settings
  db:
    connectionSet: ("-v Oracle -d xe -s oracle_host -u DefMaster -p c0mpass -dbset DefectTracking" "-v Oracle -d xe -s oracle_host -u SafeMaster -p c0mpass -dbset EssentialSAFe")

## Compass search configuration settings for searchapp1 (DefectTracking).
## searchapp1 will be used for the DefectTracking dbset.
  searchapp1:
    service: true
    hostname: search-def
    configSet: ("-username admin -password "" -dbset DefectTracking  -userdb SAMPL -searchPort 8983")
    ports:
      - 8983
    db:
      connectionSet: ("-v Oracle -d xe -s oracle_host -u DefMaster -p c0mpass -dbset DefectTracking")

## Compass search configuration settings for searchapp1 (EssentialSAFe).
## searchapp2 will be used for the EssentialSAFe dbset.
  searchapp2:
    service: true
    hostname: search-EssentialSAFe
    configSet: ("-username admin -password "" -dbset EssentialSAFe  -userdb SAMPL -searchPort 8984")
    ports: 
      - 8984
    db:
      connectionSet: ("-v Oracle -d xe -s oracle_host -u SafeMaster -p c0mpass -dbset EssentialSAFe")

## Disable the internal oracle database service
  service:
    enabled:
    oracle: false

Add -f db_values.yaml to the helm install or helm upgrade command.