Corteza Discovery

Corteza Discovery provides a powerful search engine to interact with your data. Corteza Discovery defines an intuitive interface to search and, in some cases, visualizes the data such as geographical metadata.

Refer to Multi-image Discovery with PostgreSQL for an example.

Refer to the Low-Code Platform Developer Guide  Corteza Discovery to learn how to configure and use Corteza Discovery.

Configuring Corteza Server

To enable Corteza Discovery, access the Docker container and run the following commands:

Enable Corteza Discovery for Low Code namespaces:
corteza-server settings set discovery.compose-namespaces.enabled true
Enable Corteza Discovery for Low Code modules:
corteza-server settings set discovery.compose-modules.enabled true
Enable Corteza Discovery for Low Code records:
corteza-server settings set discovery.compose-records.enabled true
Enable Corteza Discovery for users:
corteza-server settings set discovery.system-users.enabled true
Next, set the following .env variables for your Corteza server:
DISCOVERY_ENABLED=true
DISCOVERY_BASE_URL=your-discovery-server-base-url
# Optional variable for debugging
# DISCOVERY_DEBUG=true

For an example of an online deployment, refer to Multi-image Discovery with PostgreSQL.

To access the Docker container, run the following command:

docker-compose exec server bash

Configuring Corteza Discovery Server

Search Engine Requirements

Discovery requires a running instance of either Elasticsearch or OpenSearch to function.

Important: You will notice the configuration variables below use the ES_ prefix (e.g., ES_ADDRESS, ES_USERNAME). This prefix is maintained for backward compatibility. You must use these ES_ variables regardless of whether your search engine is Elasticsearch or OpenSearch.

Generating Auth Clients

Before configuring your environment variables, you must generate Auth Clients within Corteza to securely connect the Discovery Indexer and Searcher to the main server.

  1. Log into the Corteza Admin Area.

  2. Navigate to System > Auth Clients.

  3. Click New to create a client (e.g., name it "Discovery Indexer - Private").

  4. Ensure the Grant Type is set to allow client_credentials.

  5. Select a specific role that has the necessary read permissions for the data you wish to index.

  6. Click Submit.

  7. Securely copy the generated Client ID (used for the Key) and Client Secret.

  8. Repeat this process for your Protected Indexer, Public Indexer, and Searcher.

Environment Variables

Setup the following .env variables, replacing the placeholder values with your search engine details and newly generated Auth Client credentials:

ES_ADDRESS=your-open-search-url
ES_USERNAME=your-open-search-username
ES_PASSWORD=your-open-search-password
# Set to true if connecting over HTTPS
ES_SECURE=false
# Re-indexing interval in seconds
ES_INDEX_INTERVAL=60

CORTEZA_SERVER_BASE_URL=your-corteza-server-url
CORTEZA_SERVER_AUTH_URL=your-corteza-server-url/auth

DISCOVERY_INDEXER_ENABLED=true
DISCOVERY_SEARCHER_ENABLED=true

# Private indexer — indexes data visible only to the owning user
DISCOVERY_INDEXER_PRIVATE_INDEX_CLIENT_KEY=private-index-client-key
DISCOVERY_INDEXER_PRIVATE_INDEX_CLIENT_SECRET=private-index-client-secret
# Protected indexer — indexes data visible to authenticated users
DISCOVERY_INDEXER_PROTECTED_INDEX_CLIENT_KEY=protected-index-client-key
DISCOVERY_INDEXER_PROTECTED_INDEX_CLIENT_SECRET=protected-index-client-secret
# Public indexer — indexes data visible to everyone
DISCOVERY_INDEXER_PUBLIC_INDEX_CLIENT_KEY=public-index-client-key
DISCOVERY_INDEXER_PUBLIC_INDEX_CLIENT_SECRET=public-index-client-secret

# Searcher — used by the Discovery search interface
DISCOVERY_SEARCHER_CLIENT_KEY=your-searcher-client-key
DISCOVERY_SEARCHER_CLIENT_SECRET=your-searcher-client-secret