# Search

{% hint style="warning" %}
Note: as of Study Tracker v1.0, ElasticSearch is no longer supported. OpenSearch should be used in its place.
{% endhint %}

Study Tracker has an optional power search feature that is implemented with ElasticSearch. To enable this feature, you will need to connect Study Tracker with an instance of ElasticSearch version 7.10 or newer. This can be accomplished with a self-hosted instance installed on the same virtual machine as Study Tracker, or on a separate managed host, such as with Amazon's OpenSearch Service.&#x20;

### Connecting to Amazon OpenSearch Service

If you opt for using Amazon's managed OpenSearch Service, be sure that you select the latest version of OpenSearch and enable the compatibility mode option. Configure your OpenSearch instance (be sure networking config allows communication with your EC2) and then provide the following parameters to your `application.properties` file:

```
search.mode=opensearch
opensearch.host=vpc-study-tracker-xxxxxxxxx.us-east-1.es.amazonaws.com
opensearch.port=443
opensearch.use-ssl=true
opensearch.username=myusername
opensearch.password=mypassword
```

### Running a dedicated local ElasticSearch instance

The simplest setup is to run ElasticSearch from the same instance as Study Tracker, though you need to be aware of the additional CPU, memory, and disk-space usage associated with this. Follow these directions to setup a local ElasticSearch instance that will be accessible *only* to Study Tracker.

First, install the ElasticSearch packages:

```
curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /usr/share/keyrings/elastic.gpg
echo "deb [signed-by=/usr/share/keyrings/elastic.gpg] https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
sudo apt-get update
sudo apt-get install elasticsearch
```

Modify the ElasticSearch configuration to allow only connections from the same host:

```
echo "network.host: localhost" | sudo tee -a /etc/elasticsearch/elasticsearch.yml
```

Be sure to run ElasticSearch as a restartable service:

```
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service
sudo systemctl start elasticsearch.service
```

Lastly, update the Study Tracker `application.properties` file and provide the following parameters to enable power search:

```
search.mode=elasticsearch
elasticsearch.host=localhost
elasticsearch.port=9200
```


---

# 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://study-tracker.gitbook.io/documentation/installation-and-configuration/search.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.
