# Configure Elastic Cloud (optional)

{% hint style="info" %}
The release package contains everything that is required to use a co-located Elasticsearch instance by default.  Only proceed with these steps if a remote Elasticsearch cluster is required.
{% endhint %}

To configure the Terminology Server to work with a managed Elasticsearch cluster two settings require attention.

### Configure Terminology Server

First, the local Elasticsearch container and all its configurations should be removed from the docker-compose.yml file. Once that is done, we have to tell the Terminology Server where to find the cluster. This can be set in the file `./snow-owl/docker/configs/snowowl/snowowl.yml`:

```yaml
repository:
  index:
    socketTimeout: 60000
    clusterUrl: https://my-es-cluster.elastic-cloud.com:9243
    clusterUsername: my-es-cluster-user
    clusterPassword: my-es-cluster-pwd
```

### Configure Elastic Cloud

The Snow Owl Terminology Server leverages Elasticssearch's synonym filters. To have this feature work properly with a managed Elasticsearch cluster our custom dictionary has to be uploaded and configured. The synonym file can be found in the release package under `./snow-owl/docker/configs/elasticsearch/synonym.txt`. This file needs to be compressed as an `zip` archive by following this structure:

```
.
└── analysis
    └── synonym.txt
```

For the managed Elasticsearch instance this zip file needs to be configured as a bundle extension. The steps required are covered in [this guide](https://www.elastic.co/guide/en/cloud/current/ec-custom-bundles.html#ec-add-your-plugin) in great detail.

Once the bundle is configured and the cluster is up we can (re)start the docker stack. In case there are any troubles the Terminology Server will refuse to initialize and let you know what the problem is in its log files.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.b2ihealthcare.com/snow-owl/9.x/setup-and-administration/configuration/configure-elastic-cloud-optional.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
