REST API with Spring Boot and Opensearch

Eric Anicet
6 min readApr 15, 2024

Hello everyone! In this story, we will show how to use Spring Boot with OpenSearch.

· Prerequisites
· Overview
What is OpenSearch?
Why use OpenSearch?
· OpenSearch Setup with Docker
· Getting Started
Spring Data for OpenSearch
Configuring OpenSearch in Spring Boot
Document Object Mapping
OpenSearch Repositories
Service Layer
Book Controller
· Testing
· Conclusion
· References

Prerequisites

This is the list of all the prerequisites:

  • Spring Boot 3.2.4
  • Maven 3.8.+
  • Java 17
  • Postman / insomnia or any other API testing tool.
  • Docker / Docker compose installed

Overview

What is OpenSearch?

OpenSearch is a community-driven, open source search and analytics suite derived from open source Elasticsearch and Kibana,
with development…

--

--