Financial Services Creatio, sales edition
PDF
This documentation is valid for Creatio version 7.16.0. We recommend using the newest version of Creatio documentation.

Setting up the global search service (version 2.0)

Global search components

The global search service requires the deployment of two separate servers (“server 1” and “server 2”) that can be either physical or virtual machines. The system requirements for the servers are available in the “Set up global search” article.

Components to deploy on server 1:

elasticsearch – the search engine.

Components to deploy on server 2:

postgres – database for configuring the global search component.

rabbitmq – message broker.

redis – database used for caching and speed.

gs-web-api – web-service for global search component configuration.

gs-web-indexing-service – web service for processing the queries for the targeted indexing of Creatio data.

gs-scheduler – scheduler for indexing data from Creatio to ElasticSearch.

gs-worker – component of data indexing from Creatio into ElasticSearch as per the scheduler tasks.

gs-worker-replay – component processing indexation results (gs-worker operation results).

gs-worker-single – component for targeted indexing of business process data in ElasticSearch upon a request from the business process.

gs-worker-single-replay – component processing indexing results (gs-worker operation results).

gs-worker-single-task – component for scheduling tasks for gs-worker-single.

gs-worker-queried-single-task – component for generating tasks for gs-worker-single.

To set up the components, download the source files, using the following link: download files.

List of ports used by global search components

Component name

Outgoing port

Incoming port

Notes

gs-web-api

 

81

The incoming port is configured with the WEB_API_PORT variable

gs-web-indexing-service

 

82

The incoming port is configured with the WEB_INDEXING_SERVICE_PORT variable

gs-worker

9200

 

Requires connection to the server where elasticsearch is located.

gs-worker-single

9200

 

Requires connection to the server where elasticsearch is located.

elasticsearch

 

9200

 

Global search setup procedure

1.Install Docker on a physical or virtual machine running Linux OS. Read more >>>

2.Install Docker Compose. Read more >>>

3.Install ElasticSearch. Read more >>>

4.Set up the container variables. Read more >>>

5.Install and run the Global Search Service components. Read more >>>

6.Enable the global search function in Creatio. Read more >>>

Docker setup

Install Docker to Linux OS to deploy global search components. The installation is covered in the Docker documentation.

Run the “docker-version” command on a Linux machine to verify the installed Docker version.

Installing Docker Compose

The installation of Docker-Compose is covered in the Docker documentation.

Installing ElasticSearch

Note

This guide covers the procedure for deploying the ElasticSearch in Docker-Compose. You can also deploy ElasticSearch as daemon OS, which does not involve installing Docker and Docker-Compose. See the ElasticSearch guide for more information on the setup procedure.

To install ElasticSearch:

1.On the ElasticSearch installation server (server 1), open the /opt folder.

2.Download and unzip the archive with setup files to the opened folder. Download the archive 

3.Open the /opt/docker-compose/elasticsearch folder (where the components are located) and run the following command:

docker-compose up -d

The command might take up to several minutes to complete.

4.After the command is complete, make sure that the log files do not contain any errors. To do this, run the following command:

docker logs es-01

Setting up container variables

All global search component containers are configured via a file with environment variables. The variables are stored in the /opt/docker-compose/services/.env file. Edit this file to set the values of variables.

Variable name

Details

Default value

GS_ES_URL

The external ElasticSearch host, used for access from Creatio. Specify the server IP, where the ElasticSearch is deployed.

http://[ElasticSearchsever IP]:9200

Additional variables that control the data indexing parameters in ElasticSearch

Variable name

Details

Default value

GS_DB_INCREMENT_DAYS

Number of days to be indexed per one iteration of the scheduler. The ModifiedOn columns of system records are used for comparison.

500

GS_DB_FILL_QUEUE_INTERVAL

The interval for collecting data from the Creatio database by a regular scheduler. The load of the Creatio database depends on how small this parameter is. However, the primary indexing will happen faster if this parameter is smaller.

30000

Running containers with the Global Search Service components

Attention

For the correct container operation, the UTC-time on the Linux machine with Docker installed should correspond to the UTC-time on the Creatio database server. The permissible deviation is up to five minutes. Otherwise, the global search may not index all records.

1.On the server with the global search components (server 2), open the /opt folder.

2.Download and unzip the archive with setup files to the opened folder. Download the archive 

3.Open the /opt/docker-compose/elasticsearch folder (where the components are located) and run the following command:

docker-compose up -d

Verifying successful running of containers

To see the running global search containers, use the following console command:

docker ps --filter "label=service=gs" -a --format "table {{.Names}}\t{{.Ports}}\t{{.Status}}\t{{.RunningFor}}"

All currently running containers will display the Up status.

Logging

By default, the container logging takes place in the stdout and stderr.

Note

The “docker logs --tail 100 gs-worker” command displays 100 last strings from the gs-worker container.

Note

The mysql or rabbitmq containers might become temporarily unavailable on start because they run after the rest of the containers. A notification about the successful connection and start of the container will appear in the log files: “Now listening on: http://[::]:80 Application started. Press Ctrl+C to shut down.”

Connecting global search service to Creatio

Actions on the server

Attention

To connect global search to Creatio, execute the AddSite and AddSearch API operations. Use the http://[gs-web-api]:81/api link to access the description of the available global search API. The API is currently in the beta-testing mode. We appreciate your feedback!
The updated description will be available in the upcoming Creatio releases.

To connect global search to Creatio, perform the following steps on the server:

1.Install the api-get install curl or yum install curl utilities for http queries.

apt-get install curl

2.Execute the AddSite API operation and specify the following:

[DATABASE_TYPE] – Creatio database type (mssql, postgresql or oracle).

[DATABASE_CONNECTION_STRING] – connection string to the Creatio database.

[SITE_NAME] – Creatio site name, e.g. “my-test-site”

curl -v -X POST -d '{"databaseType": "[DATABASE_TYPE]", "databaseConnectionString": "[DATABASE_CONNECTION_STRING]"}' -H "Content-Type: application/json" http://[gs-webapi]:81/sites/[SITE_NAME]*

Case for MS SQL

curl -v -X POST -d '{"databaseType": "mssql", "databaseConnectionString": "Server=myserver\\mssql2016; Database=my-test-site; User Id=my-login; Password='my-password'; Connection Timeout=10"}' -H "Content-Type: application/json" http://[gs-webapi]:81/sites/my-test-site

Case for PostgreSQL

server=[SERVER_IP];port=5432;database=[DB_NAME];user id=[USER_NAME];password=[PASSWORD];timeout=10;commandtimeout=400;maxpoolsize=1024

3.Perform the AddSearch API operation and specify the following:

[SITE_NAME] – Creatio site name, e.g. “my-test-site”

[TEMPLATE_NAME] – the name of the search template used in ElasticSearch. The available templates are listed below:

curl -v -X POST -d '{"templateName": "[TEMPLATE_NAME]"}' -H "Content-Type: application/json" http://[gs-web-api]:81/sites/[SITE_NAME]/search

Case

curl -v -X POST -d '{"templateName": "default.json"}' -H "Content-Type: application/json" http://[gs-web-api]:81/sites/my-test-site/search

Note

The indicated query will return URL to the index created in ElasticSearch. Save the URL and use it in the system setting installation SQL script below.

Attention

To change the search template, run the DELETE query at /sites/{siteName}/search and the AddSearch action described above. This will enable the re-indexing of the site.

All available search templates are listed in the table below:

 

Old template (version 1.6)

default.json

ngram_2.json

ngram_3.json

without_ngram.json

Search by partial match

+

+

+

Search by misspelled words

+

+

+

Search communication options by phone number (partial match)

+

+

+

+

Search communication options (partial match)

+

+

+

+

Search by word swapping

+

+

+

+

+

Search by exact match

+

+

+

+

+

Search by two characters

+

Average search speed (the lower the better)

 

13х

<1х

Index size at elasticsearch (the less the better)

 

2,5х

<1х

Primary indexing time (the less the better)

 

1,8х

1,4х

<1х

Settings on the Creatio side

For MS SQL DBMS:

1.Enable the Feature Toggle function of the global search (GlobalSearch, GlobalSearch_V2, GlobalSearchRelatedEntityIndexing) by running the following SQL script:

DECLARE @GS_REIndexingFeature NVARCHAR(50) = 'GlobalSearchRelatedEntityIndexing';
DECLARE @GS_REIndexingFeatureId UNIQUEIDENTIFIER = (SELECT TOP 1 Id FROM Feature WHERE
Code = @GS_REIndexingFeature);

DECLARE @GlobalSearchFeature NVARCHAR(50) = 'GlobalSearch';
DECLARE @GlobalSearchFeatureId UNIQUEIDENTIFIER = (SELECT TOP 1 Id FROM Feature WHERE Code = @GlobalSearchFeature);

DECLARE @GlobalSearchV2Feature NVARCHAR(50) = 'GlobalSearch_V2';
DECLARE @GlobalSearchV2FeatureId UNIQUEIDENTIFIER = (SELECT TOP 1 Id FROM Feature WHERE Code = @GlobalSearchV2Feature);
DECLARE @allEmployeesId UNIQUEIDENTIFIER = 'A29A3BA5-4B0D-DE11-9A51-005056C00008';

IF (@GlobalSearchFeatureId IS NOT NULL)
BEGIN
   IF EXISTS (SELECT * FROM AdminUnitFeatureState WHERE FeatureId = @GlobalSearchFeatureId)
     UPDATE AdminUnitFeatureState SET FeatureState = 1 WHERE FeatureId = @GlobalSearchFeatureId
   ELSE
     INSERT INTO AdminUnitFeatureState (SysAdminUnitId, FeatureState, FeatureId) VALUES (@allEmployeesId, '1', @GlobalSearchFeatureId)
END
ELSE
BEGIN
  SET @GlobalSearchFeatureId = NEWID()
   INSERT INTO Feature (Id, Name, Code) VALUES (@GlobalSearchFeatureId, @GlobalSearchFeature, @GlobalSearchFeature)
   INSERT INTO AdminUnitFeatureState (SysAdminUnitId, FeatureState, FeatureId) VALUES (@allEmployeesId, '1', @GlobalSearchFeatureId)
END

IF (@GlobalSearchV2FeatureId IS NOT NULL)
BEGIN
   IF EXISTS (SELECT * FROM AdminUnitFeatureState WHERE FeatureId = @GlobalSearchV2FeatureId)
     UPDATE AdminUnitFeatureState SET FeatureState = 1 WHERE FeatureId = @GlobalSearchV2FeatureId
   ELSE
     INSERT INTO AdminUnitFeatureState (SysAdminUnitId, FeatureState, FeatureId) VALUES (@allEmployeesId, '1', @GlobalSearchV2FeatureId)
END
ELSE
BEGIN
  SET @GlobalSearchV2FeatureId = NEWID()
   INSERT INTO Feature (Id, Name, Code) VALUES (@GlobalSearchV2FeatureId, @GlobalSearchV2Feature, @GlobalSearchV2Feature)
   INSERT INTO AdminUnitFeatureState (SysAdminUnitId, FeatureState, FeatureId) VALUES (@allEmployeesId, '1', @GlobalSearchV2FeatureId)
END

IF (@GS_REIndexingFeatureId IS NOT NULL)
BEGIN
 IF EXISTS (SELECT * FROM AdminUnitFeatureState WHERE FeatureId = @GS_REIndexingFeatureId)
  UPDATE AdminUnitFeatureState SET FeatureState = 1 WHERE FeatureId = @GS_REIndexingFeatureId
 ELSE
  INSERT INTO AdminUnitFeatureState (SysAdminUnitId, FeatureState, FeatureId) VALUES (@allEmployeesId, '1', @GS_REIndexingFeatureId)
END
ELSE
BEGIN
SET @GS_REIndexingFeatureId = NEWID()
 INSERT INTO Feature (Id, Name, Code) VALUES (@GS_REIndexingFeatureId, @GS_REIndexingFeature, @GS_REIndexingFeature)
 INSERT INTO AdminUnitFeatureState (SysAdminUnitId, FeatureState, FeatureId) VALUES (@allEmployeesId, '1', @GS_REIndexingFeatureId)
END

2.Run the following script to set the system setting values (GlobalSearchUrl, GlobalSearchConfigServiceURL, and GlobalSearchIndexingApiUrl):

UPDATE SysSettingsValue
SET TextValue = [specify the URL to the ElasticSearch index, use a string of the following type - http://external.elasticsearch:9200/indexname]
WHERE SysSettingsId = (SELECT TOP 1 Id FROM SysSettings WHERE Code = 'GlobalSearchUrl')

UPDATE SysSettingsValue
SET TextValue = [specify URL to the Global Search Service, string of the following type - http://gs-web-api:81]
WHERE SysSettingsId = (SELECT TOP 1 Id FROM SysSettings WHERE Code ='GlobalSearchConfigServiceUrl')

UPDATE SysSettingsValue
SET TextValue = [specify URL to the Global Indexing Service, string of the following type - http://gs-web-indexing-service:82]
WHERE SysSettingsId = (SELECT TOP 1 Id FROM SysSettings WHERE Code ='GlobalSearchIndexingApiUrl')

3.Restart Creatio, flush Redis and log into the application.

For Oracle DBMS:

1.Enable the Feature Toggle function of the global search (GlobalSearch, GlobalSearch_V2, GlobalSearchRelatedEntityIndexing) by running the following SQL script:

CREATE OR REPLACE FUNCTION
generate_uuid return varchar2 is
   v_uuid varchar2(38);
   v_guid varchar2(32);
BEGIN
   v_guid := sys_guid();
   v_uuid := lower(
                '{' ||
                substr(v_guid, 1,8) || '-' ||
                substr(v_guid, 9,4) || '-' ||
                substr(v_guid, 13,4) || '-' ||
                substr(v_guid, 17,4) || '-' ||
               substr(v_guid, 21) ||
                '}'
               );
   RETURN v_uuid;
END;
/

DECLARE
 GS_REIndexingFeature VARCHAR(50) := 'GlobalSearchRelatedEntityIndexing';
GS_REIndexingFeatureId VARCHAR(38) := NULL;
GS_REIndexingFeatureId_GUID VARCHAR(38) := generate_uuid();

GlobalSearchFeature VARCHAR(50) := 'GlobalSearch';
 GlobalSearchFeatureId VARCHAR(38) := NULL;
 GlobalSearchFeatureId_GUID VARCHAR(38) := generate_uuid();
  GlobalSearchV2Feature VARCHAR(50) := 'GlobalSearch_V2';
 GlobalSearchV2FeatureId VARCHAR(38) := NULL;
 GlobalSearchV2FeatureId_GUID VARCHAR(38) := generate_uuid();
  allEmployeesId VARCHAR(38) := '{7F3B869F-34F3-4F20-AB4D-7480A5FDF647}';
 State_GlobalSearch VARCHAR(1) := NULL;
 State_GlobalSearchV2 VARCHAR(1) := NULL;
 State_GS_REI VARCHAR(1) := NULL;

BEGIN
  SELECT MAX("Id") INTO GlobalSearchFeatureId FROM "Feature" WHERE "Code" = GlobalSearchFeature AND rownum = 1;
  SELECT MAX("Id") INTO GlobalSearchV2FeatureId FROM "Feature" WHERE "Code" = GlobalSearchV2Feature AND rownum = 1;
SELECT MAX("Id") INTO GS_REIndexingFeatureId FROM "Feature" WHERE "Code" = GS_REIndexingFeature AND rownum = 1;

  SELECT MAX("FeatureState") INTO State_GlobalSearch FROM "AdminUnitFeatureState" WHERE "FeatureId" = GlobalSearchFeatureId AND rownum = 1;
  SELECT MAX("FeatureState") INTO State_GlobalSearchV2 FROM "AdminUnitFeatureState" WHERE "FeatureId" = GlobalSearchV2FeatureId AND rownum = 1;
  SELECT MAX("FeatureState") INTO State_GS_REI FROM "AdminUnitFeatureState" WHERE FeatureId" = GS_REIndexingFeatureId AND rownum = 1;

 IF (GlobalSearchFeatureId IS NULL) THEN
      INSERT INTO "Feature" ("Id", "Name", "Code") VALUES (GlobalSearchFeatureId_GUID, GlobalSearchFeature, GlobalSearchFeature);
      INSERT INTO "AdminUnitFeatureState" ("SysAdminUnitId", "FeatureState", "FeatureId") VALUES (allEmployeesId, '1', GlobalSearchFeatureId_GUID);
   ELSE
     IF (State_GlobalSearch IS NOT NULL) THEN
          UPDATE "AdminUnitFeatureState" SET "FeatureState" = 1 WHERE "FeatureId" = GlobalSearchFeatureId;
       ELSE
          INSERT INTO "AdminUnitFeatureState" ("SysAdminUnitId", "FeatureState", "FeatureId") VALUES (allEmployeesId, '1', GlobalSearchFeatureId_GUID);
     END IF;
 END IF;

 IF (GlobalSearchV2FeatureId IS NULL) THEN
      INSERT INTO "Feature" ("Id", "Name", "Code") VALUES (GlobalSearchV2FeatureId_GUID, GlobalSearchV2Feature, GlobalSearchV2Feature);
      INSERT INTO "AdminUnitFeatureState" ("SysAdminUnitId", "FeatureState", "FeatureId") VALUES (allEmployeesId, '1', GlobalSearchV2FeatureId_GUID);
   ELSE
     IF (State_GlobalSearchV2 IS NOT NULL) THEN
          UPDATE "AdminUnitFeatureState" SET "FeatureState" = 1 WHERE "FeatureId" = GlobalSearchV2FeatureId;
       ELSE
          INSERT INTO "AdminUnitFeatureState" ("SysAdminUnitId", "FeatureState", "FeatureId") VALUES (allEmployeesId, '1', GlobalSearchV2FeatureId_GUID);
     END IF;
 END IF;

IF (GS_REIndexingFeatureId IS NULL) THEN
  INSERT INTO "Feature" ("Id", "Name", "Code") VALUES (GS_REIndexingFeatureId_GUID,GS_REIndexingFeature, GS_REIndexingFeature);
  INSERT INTO "AdminUnitFeatureState" ("SysAdminUnitId", "FeatureState","FeatureId") VALUES (allEmployeesId, '1', GS_REIndexingFeatureId_GUID);
 ELSE
 IF (State_GS_REI IS NOT NULL) THEN
  UPDATE "AdminUnitFeatureState" SET "FeatureState" = 1 WHERE "FeatureId" =GS_REIndexingFeatureId;
 ELSE
  INSERT INTO "AdminUnitFeatureState" ("SysAdminUnitId", "FeatureState","FeatureId") VALUES (allEmployeesId, '1', GS_REIndexingFeatureId_GUID);
 END IF;
END IF;

END;

2.Run the following script to set the system setting values (GlobalSearchUrl, GlobalSearchConfigServiceURL, and GlobalSearchIndexingApiUrl):

DECLARE
 URL_SETTING_ID VARCHAR(38) := NULL;
 CONFIG_URL_SETTING_ID VARCHAR(38) := NULL;
 IND_API_SETTING_ID VARCHAR(38) := NULL;

 URL_VAL_ID VARCHAR(38) := NULL;
 CONFIG_URL_VAL_ID VARCHAR(38) := NULL;
 IND_API_VAL_ID VARCHAR(38) := NULL;

  SYS_ADMIN_UID VARCHAR(38) := '{A29A3BA5-4B0D-DE11-9A51-005056C00008}';

  ES_IND VARCHAR(500) := '[enter the URL to the ElasticSearch index, string of the following type - http://external.elasticsearch:9200/indexname]';
  CONFIG_URL VARCHAR(500) := '[enter the URL to the Global Search Service, string of the following type - http://gs-web-api:81]';
  IND_API_URL VARCHAR (500): = '[enter the URL to the Global Search Indexing Service, string of the following type - http://gs-web-indexing-service: 82]’
BEGIN
  SELECT "Id" INTO URL_SETTING_ID FROM "SysSettings" WHERE "Code" = 'GlobalSearchUrl';
  SELECT "Id" INTO CONFIG_URL_SETTING_ID FROM "SysSettings" WHERE "Code" = 'GlobalSearchConfigServiceUrl';
  SELECT "Id" INTO IND_API_SETTING_ID FROM "SysSettings" WHERE "Code" = 'GlobalSearchIndexingApiUrl';

  SELECT MAX("Id") INTO URL_VAL_ID  FROM "SysSettingsValue" WHERE "SysSettingsId" = URL_SETTING_ID;
  SELECT MAX("Id") INTO CONFIG_URL_VAL_ID  FROM "SysSettingsValue" WHERE "SysSettingsId" = CONFIG_URL_SETTING_ID;
  SELECT MAX("Id") INTO IND_API_VAL_ID  FROM "SysSettingsValue" WHERE "SysSettingsId" = IND_API_SETTING_ID;

 IF (URL_VAL_ID IS NULL)
   THEN
     INSERT INTO "SysSettingsValue"
       ("SysSettingsId", "SysAdminUnitId", "IsDef", "TextValue")
       VALUES
        (URL_SETTING_ID, SYS_ADMIN_UID, '1', ES_IND);
   ELSE
      UPDATE "SysSettingsValue" SET "TextValue" = ES_IND WHERE "SysSettingsId" = URL_SETTING_ID;
 END IF;

 IF (CONFIG_URL_VAL_ID IS NULL)
   THEN
     INSERT INTO "SysSettingsValue"
       ("SysSettingsId", "SysAdminUnitId", "IsDef", "TextValue")
       VALUES
        (CONFIG_URL_SETTING_ID, SYS_ADMIN_UID, '1', CONFIG_URL);
   ELSE
      UPDATE "SysSettingsValue" SET "TextValue" = CONFIG_URL WHERE "SysSettingsId" = CONFIG_URL_SETTING_ID;
 END IF;

 IF (IND_API_VAL_ID IS NULL)
   THEN
     INSERT INTO "SysSettingsValue"
       ("SysSettingsId", "SysAdminUnitId", "IsDef", "TextValue")
       VALUES
        (IND_API_SETTING_ID, SYS_ADMIN_UID, '1', IND_API_URL);
   ELSE
      UPDATE "SysSettingsValue" SET "TextValue" = IND_API_URL WHERE "SysSettingsId" = IND_API_SETTING_ID;
 END IF;
END;

3.Restart Creatio, flush Redis and log into the application.

For PostgreSQL DBMS:

1.Enable the Feature Toggle function of the global search (GlobalSearch, GlobalSearch_V2, GlobalSearchRelatedEntityIndexing) by running the following SQL script:

DO $$

DECLARE
    GlobalSearchFeature VARCHAR(50) := 'GlobalSearch';
   GlobalSearchFeatureId uuid;
    GlobalSearchV2Feature VARCHAR(50) := 'GlobalSearch_V2';
   GlobalSearchV2FeatureId uuid;
    GS_RelatedEntityIndexingFeature VARCHAR(50) :=   'GlobalSearchRelatedEntityIndexing';
   GS_RelatedEntityIndexingFeatureId uuid;
    allEmployeesId uuid := 'A29A3BA5-4B0D-DE11-9A51-005056C00008';

BEGIN

  SELECT "Id" INTO GlobalSearchFeatureId FROM "Feature"
  WHERE "Code" = GlobalSearchFeature
  LIMIT 1;
  IF (GlobalSearchFeatureId IS NOT NULL)
     THEN
          IF EXISTS (SELECT * FROM "AdminUnitFeatureState" WHERE "FeatureId" = GlobalSearchFeatureId) THEN
             UPDATE "AdminUnitFeatureState" SET "FeatureState" = 1 WHERE "FeatureId" = GlobalSearchFeatureId;
         ELSE
              INSERT INTO "AdminUnitFeatureState" ("SysAdminUnitId", "FeatureState", "FeatureId") VALUES (allEmployeesId, '1', GlobalSearchFeatureId);
         END IF;
  ELSE
      GlobalSearchFeatureId := uuid_generate_v4();
       INSERT INTO "Feature" ("Id", "Name", "Code") VALUES (GlobalSearchFeatureId, GlobalSearchFeature, GlobalSearchFeature);
       INSERT INTO "AdminUnitFeatureState" ("SysAdminUnitId", "FeatureState", "FeatureId") VALUES (allEmployeesId, '1', GlobalSearchFeatureId);
  END IF;

  SELECT "Id" INTO GlobalSearchV2FeatureId FROM "Feature”
  WHERE "Code" = GlobalSearchV2Feature
  LIMIT 1;
  IF (GlobalSearchV2FeatureId IS NOT NULL)
   THEN
        IF EXISTS (SELECT * FROM "AdminUnitFeatureState" WHERE "FeatureId" = GlobalSearchV2FeatureId) THEN
            UPDATE "AdminUnitFeatureState" SET "FeatureState" = 1 WHERE "FeatureId" = GlobalSearchV2FeatureId;
       ELSE
           INSERT INTO "AdminUnitFeatureState" ("SysAdminUnitId", "FeatureState", "FeatureId") VALUES (allEmployeesId, '1', GlobalSearchV2FeatureId);
       END IF;
  ELSE
      GlobalSearchV2FeatureId := uuid_generate_v4();
       INSERT INTO "Feature" ("Id", "Name", "Code") VALUES (GlobalSearchV2FeatureId, GlobalSearchV2Feature, GlobalSearchV2Feature);
       INSERT INTO "AdminUnitFeatureState" ("SysAdminUnitId", "FeatureState", "FeatureId") VALUES (allEmployeesId, '1', GlobalSearchV2FeatureId);
  END IF;

  SELECT "Id" INTO GS_RelatedEntityIndexingFeatureId FROM "Feature" WHERE "Code" =GS_RelatedEntityIndexingFeature LIMIT 1;
 IF (GS_RelatedEntityIndexingFeatureId IS NOT NULL)
 THEN
  IF EXISTS (SELECT * FROM "AdminUnitFeatureState" WHERE "FeatureId" = Bulk_ES_DD_FeatureId) THEN
UPDATE "AdminUnitFeatureState" SET "FeatureState" = 1 WHERE "FeatureId" = GS_RelatedEntityIndexingFeatureId;
 ELSE
  INSERT INTO "AdminUnitFeatureState" ("SysAdminUnitId", "FeatureState","FeatureId") VALUES (allEmployeesId, '1', GS_RelatedEntityIndexingFeatureId);
 END IF;
 ELSE
 GS_RelatedEntityIndexingFeatureId := uuid_generate_v4();
  INSERT INTO "Feature" ("Id", "Name", "Code") VALUES (GS_RelatedEntityIndexingFeatureId, GS_RelatedEntityIndexingFeature, GS_RelatedEntityIndexingFeature);
  INSERT INTO "AdminUnitFeatureState" ("SysAdminUnitId", "FeatureState","FeatureId") VALUES (allEmployeesId, '1', GS_RelatedEntityIndexingFeatureId);
 END IF;
END $$;

2.Run the following script to set the system setting values (GlobalSearchUrl, GlobalSearchConfigServiceURL, and GlobalSearchIndexingApiUrl):

UPDATE "SysSettingsValue"
SET TextValue = [specify URL to the ElasticSearch index, string of the following type - http://external.elasticsearch:9200/indexname]
WHERE "SysSettingsId" = (SELECT "Id" FROM "SysSettings" WHERE "Code" =
 'GlobalSearchUrl' LIMIT 1 );

UPDATE "SysSettingsValue"
SET TextValue = [specify URL to the Global Search Service, string of the following type - http://gs-web-api:81]
WHERE "SysSettingsId" = (SELECT "Id" FROM "SysSettings" WHERE "Code" = 'GlobalSearchConfigServiceUrl' LIMIT 1 );

UPDATE "SysSettingsValue"
SET TextValue = [specify URL to the Global Indexing Service, string of the following type - http://gs-web-indexing-service:82]
WHERE "SysSettingsId" = (SELECT "Id" FROM "SysSettings" WHERE "Code" = 'GlobalSearchIndexingApiUrl' LIMIT 1 );

3.Restart Creatio, flush Redis and log into the application.

See also

Global search

Deduplication FAQ

 

Did you find this information useful?

How can we improve it?