# OpenSearch Implementation

Showcases saving data and performing swift geospatial or text-based searches in OpenSearch as an alternative to Elasticsearch.

***

## Key Features

* **OpenSearch Client**: Illustrates setting up a Spring Boot app to send documents to an OpenSearch cluster.
* **Geospatial Queries**: Provides examples of storing and querying location-based data.
* **High Throughput**: Demonstrates efficient indexing and search operations.

***

### **Querying**

You can use either:

* Swagger UI for built-in endpoints.
* OpenSearch Dashboards for manual searching.

***

### Format code

```shell
./mvnw spotless:apply
```

### Run tests

```shell
./mvnw clean verify
```

### Run locally

```shell
docker-compose -f docker/docker-compose.yml up -d
./mvnw spring-boot:run -Dspring-boot.run.profiles=local
```

### Using Testcontainers at Development Time

You can run `TestApplication.java` from your IDE directly. You can also run the application using Maven as follows:

```shell
./mvnw spring-boot:test-run
```

### Useful Links

* Swagger UI: <http://localhost:8080/swagger-ui.html>
* Actuator Endpoint: <http://localhost:8080/actuator>


---

# 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://rajadilipkolli.gitbook.io/my-spring-boot-experiments/boot-opensearch-sample.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.
