{"id":35698,"date":"2025-02-27T10:33:22","date_gmt":"2025-02-27T05:03:22","guid":{"rendered":"https:\/\/mobisoftinfotech.com\/resources\/?p=35698"},"modified":"2025-10-15T17:04:14","modified_gmt":"2025-10-15T11:34:14","slug":"opensearch-java-client-spring-boot-search-integration","status":"publish","type":"post","link":"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration","title":{"rendered":"Using OpenSearch Java Client and Spring Boot for Powerful Search Integration"},"content":{"rendered":"<p>In today&#8217;s data-driven world, the ability to quickly search, analyze, and visualize vast amounts of information is crucial. Enter OpenSearch, a powerful and versatile open-source suite designed to do just that. But what exactly is OpenSearch, and why should you consider it? Let&#8217;s break it down.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What is OpenSearch and How Does the OpenSearch Java Client Work?<\/strong><\/h2>\n\n\n\n<p>At its core, OpenSearch is an open-source search and analytics suite. Think of it as a toolbox packed with everything you need to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Index and store massive datasets<\/strong>: From application logs and website traffic to e-commerce transactions and sensor data, OpenSearch can handle it all.<\/li>\n\n\n\n<li><strong>Search and explore your data in near real-time<\/strong>: Need to find specific information quickly? OpenSearch offers powerful full-text search, structured search, and even geospatial search capabilities.<\/li>\n\n\n\n<li><strong>Visualize and analyze your data<\/strong>: Go beyond simple search with built-in tools for creating dashboards, visualizations, and reports to gain deeper insights from your data.<\/li>\n<\/ul>\n\n\n\n<p>OpenSearch is built upon the foundation of Apache 2.0 licensed software, ensuring it&#8217;s truly open and free to use, modify, and distribute. It&#8217;s designed to be highly scalable and distributed, meaning it can grow with your data needs, whether you&#8217;re a small startup or a large enterprise.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/mobisoftinfotech.com\/contact-us?utm_source=blog&amp;utm_medium=referral&amp;utm_campaign=opensearch-java-client-spring-boot-search-integration-cta\"><noscript><img decoding=\"async\" width=\"855\" height=\"150\" src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/02\/integrate-opensearch-java-spring-boot-guide.png\" alt=\"Step-by-step guide to integrate OpenSearch with Java and Spring Boot\" class=\"wp-image-35706\" title=\"Step-by-Step Guide to Integrate OpenSearch with Java and Spring Boot\"><\/noscript><img decoding=\"async\" width=\"855\" height=\"150\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20855%20150%22%3E%3C%2Fsvg%3E\" alt=\"Step-by-step guide to integrate OpenSearch with Java and Spring Boot\" class=\"wp-image-35706 lazyload\" title=\"Step-by-Step Guide to Integrate OpenSearch with Java and Spring Boot\" data-src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/02\/integrate-opensearch-java-spring-boot-guide.png\"><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>The Backstory: Why OpenSearch Exists and How It Compares to Elasticsearch<\/strong><\/h2>\n\n\n\n<p>To understand OpenSearch fully, it&#8217;s important to know its origins. OpenSearch is a fork of Elasticsearch and Kibana. This happened when Elasticsearch, originally open source, transitioned to a dual license model that restricted certain features. A community-driven effort emerged to maintain a truly open-source alternative, leading to the birth of OpenSearch.&nbsp;<\/p>\n\n\n\n<p>This backstory is important because it highlights the commitment to open source principles that are deeply embedded in OpenSearch. It&#8217;s not just about free software; it&#8217;s about community collaboration, transparency, and ensuring powerful search and analytics tools remain accessible to everyone.<\/p>\n\n\n\n<p>In this context, the OpenSearch vs Elasticsearch comparison becomes important for developers when considering which search solution best fits their application needs.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Key Benefits of OpenSearch: Why Choose OpenSearch Java SDK for Your Application?<\/strong><\/h2>\n\n\n\n<p>Now, let&#8217;s get to the juicy part: the benefits of using OpenSearch. Here are some compelling reasons why you should consider it for your search and analytics needs:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Truly Open Source<\/strong>: This is perhaps the biggest differentiator. OpenSearch is licensed under Apache 2.0, guaranteeing freedom from vendor lock-in and licensing fees. You have full control and transparency over the software.<\/li>\n\n\n\n<li><strong>Cost-Effective<\/strong>: Beyond the lack of licensing fees, OpenSearch can lead to significant cost savings compared to proprietary solutions. You control your infrastructure and can optimize resource usage.<\/li>\n\n\n\n<li><strong>Highly Scalable and Performant<\/strong>: Designed for massive datasets and high query volumes, OpenSearch can scale horizontally to handle growing data needs. It&#8217;s built for speed and efficiency. To maximize the effectiveness of OpenSearch, performance tuning is essential, especially for high-query-volume applications.<\/li>\n\n\n\n<li><strong>Feature-Rich<\/strong>: Don\u2019t think open source means lacking features. OpenSearch is packed with powerful capabilities:\n<ul class=\"wp-block-list\">\n<li><strong>Full-Text Search<\/strong>: Find relevant information within documents using advanced text analysis.<\/li>\n\n\n\n<li><strong>Structured Search<\/strong>: Query data based on specific fields and values.<\/li>\n\n\n\n<li><strong>Geospatial Search<\/strong>: Analyze location-based data.<\/li>\n\n\n\n<li><strong>Analytics and Aggregations<\/strong>: Perform complex data aggregations and calculations.<\/li>\n\n\n\n<li><strong>Dashboards and Visualizations<\/strong>: Create interactive dashboards to monitor key metrics and gain insights.<\/li>\n\n\n\n<li><strong>Observability Features<\/strong>: Analyze logs, metrics, and traces for system monitoring and troubleshooting.<\/li>\n\n\n\n<li><strong>Security Features<\/strong>: Role-based access control, encryption, and auditing to protect your data.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Extensible and Customizable<\/strong>: OpenSearch is designed to be extended with plugins and integrations. You can tailor it to your specific needs and connect it with other tools in your ecosystem.<\/li>\n\n\n\n<li><strong>Active Community and Support<\/strong>: OpenSearch boasts a vibrant and growing community of developers, users, and contributors. You&#8217;ll find ample documentation, forums, and community support resources to help you along the way.<\/li>\n\n\n\n<li><strong>Flexibility and Deployment Options<\/strong>: You can deploy OpenSearch on-premises, in the cloud (self-managed or through managed services offered by various cloud providers), or in hybrid environments.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step-by-Step Implementation of OpenSearch in Spring Boot<\/strong><\/h2>\n\n\n\n<p>Let\u2019s break down the key parts of our Spring Boot application. By using the OpenSearch Java SDK, integrating OpenSearch becomes easier than ever.<\/p>\n\n\n\n<p>Download the source code and necessary Docker files from our <a href=\"https:\/\/github.com\/mobisoftinfotech\/opensearch-java-client-spring-boot\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub<\/a> repository<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Prerequisites:<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Java and Maven<\/strong>: Ensure you have Java and a build tool like Maven or Gradle installed.<\/li>\n\n\n\n<li><strong>Your Favorite IDE<\/strong>: IntelliJ IDEA, Eclipse, or VS Code will work great.<\/li>\n\n\n\n<li><strong>Running OpenSearch Instance<\/strong>:&nbsp; Make sure you have an OpenSearch instance running locally or accessible. You can use Docker for a quick setup. I have included a docker-compose file in the source code. You can run the below command to start the OpenSearch with 2 nodes and a dashboard.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code code-custom\"><code>docker compose -f docker\/opensearch-compose.yaml -p opensearch up&nbsp;<\/code><\/pre>\n\n\n\n<p>You can open this URL and see if OpenSearch node is up and running <a href=\"https:\/\/localhost:9200\/_cluster\/health\">https:\/\/localhost:9200\/_cluster\/health<\/a><br>It will prompt for username and password. The username is admin by default and the password we have provided in the compose file environment section. You can change the password there <\/p>\n\n\n\n<pre class=\"wp-block-code\" style=\"margin-top:-20px;\"><code>OPENSEARCH_INITIAL_ADMIN_PASSWORD<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. Project Setup (using Spring Initializr):<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><noscript><img decoding=\"async\" width=\"1200\" height=\"557\" src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/02\/opensearch-java-spring-boot-architecture.png\" alt=\"Architecture diagram for OpenSearch Java Client and Spring Boot integration\" class=\"wp-image-35707\" title=\"Architecture Diagram for OpenSearch Java Client and Spring Boot\"><\/noscript><img decoding=\"async\" width=\"1200\" height=\"557\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201200%20557%22%3E%3C%2Fsvg%3E\" alt=\"Architecture diagram for OpenSearch Java Client and Spring Boot integration\" class=\"wp-image-35707 lazyload\" title=\"Architecture Diagram for OpenSearch Java Client and Spring Boot\" data-src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/02\/opensearch-java-spring-boot-architecture.png\"><\/figure>\n\n\n\n<p>Go to<a href=\"https:\/\/start.spring.io\/\" target=\"_blank\" rel=\"noreferrer noopener\"> https:\/\/start.spring.io\/<\/a> and create a new Spring Boot project with the following dependencies:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Spring Web:<\/strong> For building our REST API.<\/li>\n\n\n\n<li><strong>H2 database:<\/strong> Provides a fast in-memory database that supports JDBC.<\/li>\n\n\n\n<li><strong>Lombok: <\/strong>Java annotation library which helps to reduce boilerplate code.<\/li>\n\n\n\n<li><strong>Spring Data JPA: <\/strong>Persist data in SQL stores with Java Persistence API using Spring Data and Hibernate.<\/li>\n<\/ul>\n\n\n\n<p>Choose your preferred build tool (Maven or Gradle), language (Java), and Spring Boot version. Generate and download the project.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. Add OpenSearch Dependency<\/strong><\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">dependency<\/span>&gt;<\/span>\n\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">groupId<\/span>&gt;<\/span>org.opensearch.client<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">groupId<\/span>&gt;<\/span>\n\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">artifactId<\/span>&gt;<\/span>opensearch-rest-client<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">artifactId<\/span>&gt;<\/span>\n\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">version<\/span>&gt;<\/span>2.19.0<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">version<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">dependency<\/span>&gt;<\/span>\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">dependency<\/span>&gt;<\/span>\n\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">groupId<\/span>&gt;<\/span>org.opensearch.client<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">groupId<\/span>&gt;<\/span>\n\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">artifactId<\/span>&gt;<\/span>opensearch-java<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">artifactId<\/span>&gt;<\/span>\n\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">version<\/span>&gt;<\/span>2.6.0<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">version<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">dependency<\/span>&gt;<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\"><strong>3. Configure Database and OpenSearch Connection (application.yml):<\/strong><br><\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\"><span class=\"hljs-selector-tag\">spring<\/span>:\n\n&nbsp;<span class=\"hljs-selector-tag\">application<\/span>:\n\n&nbsp;&nbsp;&nbsp;<span class=\"hljs-selector-tag\">name<\/span>: <span class=\"hljs-selector-tag\">opensearchdemo<\/span>\n\n&nbsp;<span class=\"hljs-selector-tag\">datasource<\/span>:\n\n&nbsp;&nbsp;&nbsp;<span class=\"hljs-selector-tag\">url<\/span>: <span class=\"hljs-selector-tag\">jdbc<\/span><span class=\"hljs-selector-pseudo\">:h2<\/span><span class=\"hljs-selector-pseudo\">:mem<\/span><span class=\"hljs-selector-pseudo\">:testdb<\/span>\n\n&nbsp;&nbsp;&nbsp;<span class=\"hljs-selector-tag\">driverClassName<\/span>: <span class=\"hljs-selector-tag\">org<\/span><span class=\"hljs-selector-class\">.h2<\/span><span class=\"hljs-selector-class\">.Driver<\/span>\n\n&nbsp;&nbsp;&nbsp;<span class=\"hljs-selector-tag\">username<\/span>: <span class=\"hljs-selector-tag\">sa<\/span>\n\n&nbsp;&nbsp;&nbsp;<span class=\"hljs-selector-tag\">password<\/span>: <span class=\"hljs-selector-tag\">password<\/span>\n\n&nbsp;<span class=\"hljs-selector-tag\">jpa<\/span>:\n\n&nbsp;&nbsp;&nbsp;<span class=\"hljs-selector-tag\">database-platform<\/span>: <span class=\"hljs-selector-tag\">org<\/span><span class=\"hljs-selector-class\">.hibernate<\/span><span class=\"hljs-selector-class\">.dialect<\/span><span class=\"hljs-selector-class\">.H2Dialect<\/span>\n\n&nbsp;<span class=\"hljs-selector-tag\">h2<\/span>:\n\n&nbsp;&nbsp;&nbsp;<span class=\"hljs-selector-tag\">console<\/span>:\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-selector-tag\">enabled<\/span>: <span class=\"hljs-selector-tag\">true<\/span>\n\n<span class=\"hljs-selector-tag\">opensearch<\/span>:\n\n&nbsp;<span class=\"hljs-selector-tag\">host<\/span>: <span class=\"hljs-selector-tag\">localhost<\/span>\n\n&nbsp;<span class=\"hljs-selector-tag\">port<\/span>: 9200\n\n&nbsp;<span class=\"hljs-selector-tag\">scheme<\/span>: <span class=\"hljs-selector-tag\">https<\/span>\n\n&nbsp;<span class=\"hljs-selector-tag\">username<\/span>: <span class=\"hljs-selector-tag\">admin<\/span>\n\n&nbsp;<span class=\"hljs-selector-tag\">password<\/span>: <span class=\"hljs-selector-tag\">Random<\/span>!<span class=\"hljs-selector-tag\">Password1<\/span>\n\n&nbsp;<span class=\"hljs-selector-tag\">truststore<\/span>:\n\n&nbsp;&nbsp;&nbsp;<span class=\"hljs-selector-tag\">path<\/span>: <span class=\"hljs-selector-tag\">opensearch-truststore<\/span><span class=\"hljs-selector-class\">.jks<\/span>\n\n&nbsp;&nbsp;&nbsp;<span class=\"hljs-selector-tag\">password<\/span>: <span class=\"hljs-selector-tag\">changeit<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\"><strong>4. Create an OpenSearch Configuration Class<\/strong><\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">@Configuration\n\n<span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">OpenSearchConfig<\/span> <\/span>{\n\n&nbsp;&nbsp;&nbsp;@Value(<span class=\"hljs-string\">\"${opensearch.host}\"<\/span>)\n\n&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">private<\/span> String host;\n\n&nbsp;&nbsp;&nbsp;@Value(<span class=\"hljs-string\">\"${opensearch.port}\"<\/span>)\n\n&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">private<\/span> int port;\n\n&nbsp;&nbsp;&nbsp;@Value(<span class=\"hljs-string\">\"${opensearch.username}\"<\/span>)\n\n&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">private<\/span> String username;\n\n&nbsp;&nbsp;&nbsp;@Value(<span class=\"hljs-string\">\"${opensearch.password}\"<\/span>)\n\n&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">private<\/span> String password;\n\n&nbsp;&nbsp;&nbsp;@Value(<span class=\"hljs-string\">\"${opensearch.scheme}\"<\/span>)\n\n&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">private<\/span> String scheme;\n\n&nbsp;&nbsp;&nbsp;@Value(<span class=\"hljs-string\">\"${opensearch.ssl.truststore.path}\"<\/span>)\n\n&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">private<\/span> String truststorePath;\n\n&nbsp;&nbsp;&nbsp;@Bean\n\n&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">public<\/span> OpenSearchClient openSearchClient() throws <span class=\"hljs-keyword\">Exception<\/span> {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">final<\/span> HttpHost host = <span class=\"hljs-keyword\">new<\/span> HttpHost(this.host, this.port, this.scheme);\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;KeyStore truststore = KeyStore.getInstance(<span class=\"hljs-string\">\"JKS\"<\/span>);\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">try<\/span> (InputStream is = <span class=\"hljs-keyword\">new<\/span> ClassPathResource(<span class=\"hljs-string\">\"opensearch-truststore.jks\"<\/span>).getInputStream()) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;truststore.load(is, <span class=\"hljs-string\">\"changeit\"<\/span>.toCharArray());\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-comment\">\/\/ Create SSL context<\/span>\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tmf.init(truststore);\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SSLContext sslContext = SSLContext.getInstance(<span class=\"hljs-string\">\"TLS\"<\/span>);\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sslContext.init(<span class=\"hljs-keyword\">null<\/span>, tmf.getTrustManagers(), <span class=\"hljs-keyword\">null<\/span>);\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-comment\">\/\/ Set up credentials<\/span>\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">final<\/span> BasicCredentialsProvider credentialsProvider = <span class=\"hljs-keyword\">new<\/span> BasicCredentialsProvider();\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;credentialsProvider.setCredentials(<span class=\"hljs-keyword\">new<\/span> AuthScope(host),\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">new<\/span> UsernamePasswordCredentials(this.username, this.password));\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-comment\">\/\/ Initialize the client with SSL and credentials<\/span>\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">final<\/span> RestClient restClient = RestClient.builder(host)\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.setHttpClientConfigCallback(httpClientBuilder -&gt; httpClientBuilder\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.setDefaultCredentialsProvider(credentialsProvider)\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.setSSLContext(sslContext))\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.build();\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">final<\/span> OpenSearchTransport transport = <span class=\"hljs-keyword\">new<\/span> RestClientTransport(restClient, <span class=\"hljs-keyword\">new<\/span> JacksonJsonpMapper());\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-keyword\">new<\/span> OpenSearchClient(transport);\n\n&nbsp;&nbsp;&nbsp;}\n\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\"><strong>5. Create a Service &amp; Repository Class to Save and retrieve data to and from OpenSearch<\/strong><\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">@Service\n\npublic <span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">StudentService<\/span> <\/span>{\n\n&nbsp;&nbsp;&nbsp;private final StudentRepository studentRepository;\n\n&nbsp;&nbsp;&nbsp;private final OpenSearchClient openSearchClient;\n\n&nbsp;&nbsp;&nbsp;private <span class=\"hljs-keyword\">static<\/span> final <span class=\"hljs-built_in\">String<\/span> STUDENT_INDEX = <span class=\"hljs-string\">\"students\"<\/span>;\n\n&nbsp;&nbsp;&nbsp;@Autowired\n\n&nbsp;&nbsp;&nbsp;public StudentService(StudentRepository studentRepository, OpenSearchClient openSearchClient) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">this<\/span>.studentRepository = studentRepository;\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">this<\/span>.openSearchClient = openSearchClient;\n\n&nbsp;&nbsp;&nbsp;}\n\n&nbsp;&nbsp;&nbsp;public Student createStudent(Student student) throws IOException {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-comment\">\/\/ Save to Database<\/span>\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Student savedStudent = studentRepository.save(student);\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-comment\">\/\/ Save to OpenSearch<\/span>\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;openSearchClient.index(i -&gt; i.index(STUDENT_INDEX).id(savedStudent.getId().toString()).document(savedStudent));\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">return<\/span> savedStudent;\n\n&nbsp;&nbsp;&nbsp;}\n\n&nbsp;&nbsp;&nbsp;public Student updateStudent(Long id, Student student) throws IOException {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Student existingStudent = getStudent(id);\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;existingStudent.setName(student.getName());\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;existingStudent.setEmail(student.getEmail());\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-comment\">\/\/ Update in Database<\/span>\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Student updatedStudent = studentRepository.save(existingStudent);\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-comment\">\/\/ Update in OpenSearch<\/span>\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;openSearchClient.index(i -&gt; i.index(STUDENT_INDEX).id(<span class=\"hljs-built_in\">String<\/span>.valueOf(id)).document(updatedStudent));\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">return<\/span> updatedStudent;\n\n&nbsp;&nbsp;&nbsp;}\n\n&nbsp;&nbsp;&nbsp;public Student getStudent(Long id) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-comment\">\/\/ Get from Database<\/span>\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">return<\/span> studentRepository.findById(id)\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.orElseThrow(() -&gt; <span class=\"hljs-keyword\">new<\/span> RuntimeException(<span class=\"hljs-string\">\"Student not found\"<\/span>));\n\n&nbsp;&nbsp;&nbsp;}\n\n&nbsp;&nbsp;&nbsp;public <span class=\"hljs-keyword\">void<\/span> deleteStudent(Long id) throws IOException {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-comment\">\/\/ Delete from OpenSearch<\/span>\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;openSearchClient.delete(d -&gt; d.index(STUDENT_INDEX).id(<span class=\"hljs-built_in\">String<\/span>.valueOf(id)));\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-comment\">\/\/ Delete from Database<\/span>\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;studentRepository.deleteById(id);\n\n&nbsp;&nbsp;&nbsp;}\n\n&nbsp;&nbsp;&nbsp;public List&lt;Student&gt; searchStudents(StudentSearchRequest searchRequest) throws IOException {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-comment\">\/\/ Build the search query<\/span>\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BoolQuery.Builder boolQueryBuilder = <span class=\"hljs-keyword\">new<\/span> BoolQuery.Builder();\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-comment\">\/\/ Add search conditions for each field<\/span>\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">if<\/span> (searchRequest.getSearchFields() != <span class=\"hljs-literal\">null<\/span>) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">for<\/span> (<span class=\"hljs-built_in\">Map<\/span>.Entry&lt;<span class=\"hljs-built_in\">String<\/span>, <span class=\"hljs-built_in\">String<\/span>&gt; field : searchRequest.getSearchFields().entrySet()) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;boolQueryBuilder.must(Query.of(q -&gt; q\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.match(m -&gt; m\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.field(field.getKey())\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.query(FieldValue.of(field.getValue()))\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;));\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-comment\">\/\/ Build the search request with pagination<\/span>\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SearchRequest request = <span class=\"hljs-keyword\">new<\/span> SearchRequest.Builder()\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.index(STUDENT_INDEX)\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.query(boolQueryBuilder.build()._toQuery())\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.from(searchRequest.getOffset())\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.size(searchRequest.getLimit())\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.build();\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-comment\">\/\/ Execute search<\/span>\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SearchResponse&lt;Student&gt; searchResponse = openSearchClient.search(request, Student.class);\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-comment\">\/\/ Convert response to list<\/span>\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;List&lt;Student&gt; students = <span class=\"hljs-keyword\">new<\/span> ArrayList&lt;&gt;();\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;searchResponse.hits().hits().forEach(hit -&gt; students.add(hit.source()));\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">return<\/span> students;\n\n&nbsp;&nbsp;&nbsp;}\n\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\"><strong>6. Create a REST Controller (<\/strong><strong>StudentController.java<\/strong><strong>):<\/strong><\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">@RestController\n\n@RequestMapping(<span class=\"hljs-string\">\"\/api\/v1\/students\"<\/span>)\n\npublic <span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">StudentsController<\/span> <\/span>{\n\n&nbsp;&nbsp;&nbsp;private <span class=\"hljs-keyword\">static<\/span> final Logger LOGGER = LoggerFactory.getLogger(StudentsController.class);\n\n&nbsp;&nbsp;&nbsp;@Autowired\n\n&nbsp;&nbsp;&nbsp;private StudentService studentService;\n\n&nbsp;&nbsp;&nbsp;@PostMapping\n\n&nbsp;&nbsp;&nbsp;public ResponseEntity&lt;Student&gt; createStudent(@RequestBody Student student) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">try<\/span> {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Student createdStudent = studentService.createStudent(student);\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">return<\/span> ResponseEntity.ok(createdStudent);\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <span class=\"hljs-keyword\">catch<\/span> (IOException e) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LOGGER.error(<span class=\"hljs-string\">\"Error creating student\"<\/span>, e);\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">return<\/span> ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build();\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n\n&nbsp;&nbsp;&nbsp;}\n\n&nbsp;&nbsp;&nbsp;@PutMapping(<span class=\"hljs-string\">\"\/{id}\"<\/span>)\n\n&nbsp;&nbsp;&nbsp;public ResponseEntity&lt;Student&gt; updateStudent(@PathVariable Long id, @RequestBody Student student) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Student existingStudent = studentService.getStudent(id);\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">if<\/span> (existingStudent == <span class=\"hljs-literal\">null<\/span>) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">return<\/span> ResponseEntity.status(HttpStatus.NOT_FOUND).build();\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">try<\/span> {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Student updatedStudent = studentService.updateStudent(id, student);\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">return<\/span> ResponseEntity.ok(updatedStudent);\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <span class=\"hljs-keyword\">catch<\/span> (IOException e) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LOGGER.error(<span class=\"hljs-string\">\"Error updating student\"<\/span>, e);\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">return<\/span> ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build();\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n\n&nbsp;&nbsp;&nbsp;}\n\n&nbsp;&nbsp;&nbsp;@PostMapping(<span class=\"hljs-string\">\"\/search\"<\/span>)\n\n&nbsp;&nbsp;&nbsp;public ResponseEntity&lt;List&lt;Student&gt;&gt; searchStudents(@RequestBody StudentSearchRequest searchRequest) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">try<\/span> {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;List&lt;Student&gt; students = studentService.searchStudents(searchRequest);\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">return<\/span> ResponseEntity.ok(students);\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <span class=\"hljs-keyword\">catch<\/span> (IOException e) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LOGGER.error(<span class=\"hljs-string\">\"Error searching students\"<\/span>, e);\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\">return<\/span> ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build();\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n\n&nbsp;&nbsp;&nbsp;}\n\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\"><strong>Run the application and test with Swagger<\/strong><\/h3>\n\n\n\n<p><a href=\"http:\/\/localhost:8080\/swagger-ui\/index.html#\" target=\"_blank\" rel=\"noreferrer noopener\">http:\/\/localhost:8080\/swagger-ui\/index.html#<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>From powering lightning-fast search experiences to enabling insightful data analysis, OpenSearch, especially when used as a search cache, transforms how applications interact with data. By offloading search workloads and providing specialized search capabilities, it frees up your primary systems and unlocks new levels of performance and user satisfaction. As data volumes continue to explode, tools like OpenSearch, with their open, scalable, and adaptable nature, will become increasingly indispensable for building responsive and intelligent applications. The future of data interaction is open and searchable, and OpenSearch is at the forefront.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/mobisoftinfotech.com\/contact-us?utm_source=blog&amp;utm_medium=referral&amp;utm_campaign=opensearch-java-client-spring-boot-search-integration-cta2\"><noscript><img decoding=\"async\" width=\"855\" height=\"150\" src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/02\/optimize-search-performance-opensearch-java.png\" alt=\"Optimize search performance using OpenSearch and Java integration\" class=\"wp-image-35710\" title=\"Optimize Search Performance with OpenSearch and Java\"><\/noscript><img decoding=\"async\" width=\"855\" height=\"150\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20855%20150%22%3E%3C%2Fsvg%3E\" alt=\"Optimize search performance using OpenSearch and Java integration\" class=\"wp-image-35710 lazyload\" title=\"Optimize Search Performance with OpenSearch and Java\" data-src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/02\/optimize-search-performance-opensearch-java.png\"><\/a><\/figure>\n\n\n<div class=\"related-posts-section\"><h2>Related Posts<\/h2><ul class=\"related-posts-list\"><li><a href=\"https:\/\/mobisoftinfotech.com\/resources\/blog\/android-12-update\">UI Changes with Android 12 Update: What\u2019s Changed?<\/a><\/li><li><a href=\"https:\/\/mobisoftinfotech.com\/resources\/blog\/why-ios-10-3-is-gaining-popularity-among-the-users\">Why iOS 10.3 Is Gaining Popularity among the Users?<\/a><\/li><li><a href=\"https:\/\/mobisoftinfotech.com\/resources\/blog\/park-and-ride-services\">Park and Ride System: Is It Defining Better Future for Urban Commuters?<\/a><\/li><li><a href=\"https:\/\/mobisoftinfotech.com\/resources\/blog\/qr-codes-to-enhance-patient-outcome\">How Healthcare Providers are Using QR Codes to Enhance Patient Outcomes?<\/a><\/li><li><a href=\"https:\/\/mobisoftinfotech.com\/resources\/blog\/investor-relationship-utility-functionality-organization\">Investor Relationship: Its Utility And Functionality In An Organization<\/a><\/li><li><a href=\"https:\/\/mobisoftinfotech.com\/resources\/blog\/scanning-solutions-for-retail-industry\">Scanning Solutions for Retail Industry Counteracting to the Pandemic World<\/a><\/li><\/ul><\/div>\n\n\n<div class=\"modern-author-card\">\n    <div class=\"author-card-content\">\n        <div class=\"author-info-section\">\n            <div class=\"author-avatar\">\n                <noscript><img decoding=\"async\" src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2024\/12\/Pratik.png\" alt=\"Pratik Kale\"><\/noscript><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODlhAQABAIAAAAAAAP\/\/\/yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\" alt=\"Pratik Kale\" data-src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2024\/12\/Pratik.png\" class=\" lazyload\">\n            <\/div>\n            <div class=\"author-details\">\n                <h3 class=\"author-name\">Pratik Kale<\/h3>\n                <p class=\"author-title\">Web and Cloud Technology Team Lead<\/p>\n                <a href=\"javascript:void(0);\" class=\"read-more-link read-more-btn\" onclick=\"toggleAuthorBio(this); return false;\">Read more <noscript><img decoding=\"async\" src=\"\/assets\/images\/blog\/Vector.png\" alt=\"expand\" class=\"read-more-arrow down-arrow\"><\/noscript><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODlhAQABAIAAAAAAAP\/\/\/yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\" alt=\"expand\" class=\"read-more-arrow down-arrow lazyload\" data-src=\"\/assets\/images\/blog\/Vector.png\"><\/a>\n                <div class=\"author-bio-expanded\">\n                    <p>Pratik Kale leads the Web and Cloud technology team at <a href=\"https:\/\/mobisoftinfotech.com\" target=\"_blank\" rel=\"noopener\">Mobisoft Infotech<\/a>. With 14 years of experience, he specializes in building complex software systems, particularly focusing on backend development and cloud computing. He is an expert in programming languages like Java and Node.js, and frameworks like Spring Boot. Pratik creates technology solutions that not only solve current business problems but are also designed to handle future challenges.<\/p>\n                    <div class=\"author-social-links\"><div class=\"social-icon\"><a href=\"https:\/\/www.linkedin.com\/in\/kale-pratik\/\" target=\"_blank\" rel=\"nofollow noopener\"><i class=\"icon-sprite linkedin\"><\/i><\/a>\n                     <a href=\"https:\/\/x.com\/kalepratikp\" target=\"_blank\" rel=\"nofollow noopener\"><i class=\"icon-sprite twitter\"><\/i><\/a><\/div><\/div>\n                    <a href=\"javascript:void(0);\" class=\"read-more-link read-less-btn\" onclick=\"toggleAuthorBio(this); return false;\" style=\"display: none;\">Read less <noscript><img decoding=\"async\" src=\"\/assets\/images\/blog\/Vector.png\" alt=\"collapse\" class=\"read-more-arrow up-arrow\"><\/noscript><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODlhAQABAIAAAAAAAP\/\/\/yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\" alt=\"collapse\" class=\"read-more-arrow up-arrow lazyload\" data-src=\"\/assets\/images\/blog\/Vector.png\"><\/a>\n                <\/div>\n            <\/div>\n        <\/div>\n        <div class=\"share-section\">\n            <span class=\"share-label\">Share Article<\/span>\n            <div class=\"social-share-buttons\">\n                <a href=\"https:\/\/www.facebook.com\/sharer\/sharer.php?u=https%3A%2F%2Fmobisoftinfotech.com%2Fresources%2Fblog%2Fopensearch-java-client-spring-boot-search-integration\" target=\"_blank\" class=\"share-btn facebook-share\"><i class=\"fa fa-facebook-f\"><\/i><\/a>\n                <a href=\"https:\/\/www.linkedin.com\/sharing\/share-offsite\/?url=https%3A%2F%2Fmobisoftinfotech.com%2Fresources%2Fblog%2Fopensearch-java-client-spring-boot-search-integration\" target=\"_blank\" class=\"share-btn linkedin-share\"><i class=\"fa fa-linkedin\"><\/i><\/a>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/div>\n\n\n\n<script type=\"application\/ld+json\">\n{\n  \"@context\": \"https:\/\/schema.org\",\n  \"@type\": \"Article\",\n  \"mainEntityOfPage\": {\n    \"@type\": \"WebPage\",\n    \"@id\": \"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration\"\n  },\n  \"headline\": \"Using OpenSearch Java Client and Spring Boot for Powerful Search Integration\",\n  \"description\": \"Learn how to integrate OpenSearch Java Client with Spring Boot for powerful search functionality and performance tuning in your application.\",\n  \"image\": \"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/02\/opensearch-java-client-spring-boot-integration.png\",\n  \"author\": {\n    \"@type\": \"Person\",\n    \"name\": \"Pratik Kale\",\n    \"description\": \"Pratik Kale leads the Web and Cloud technology team at Mobisoft Infotech. With 14 years of experience, he specializes in building complex software systems, particularly focusing on backend development and cloud computing. He is an expert in programming languages like Java and Node.js, and frameworks like Spring Boot. Pratik creates technology solutions that not only solve current business problems but are also designed to handle future challenges.\"\n  },\n  \"publisher\": {\n    \"@type\": \"Organization\",\n    \"name\": \"Mobisoft Infotech\",\n    \"logo\": {\n      \"@type\": \"ImageObject\",\n      \"url\": \"https:\/\/mobisoftinfotech.com\/assets\/images\/mshomepage\/MI_Logo-white.svg\",\n      \"width\": 600,\n      \"height\": 60\n    }\n  },\n  \"datePublished\": \"2025-02-27\",\n  \"dateModified\": \"2025-02-27\"\n}\n<\/script>\n<script type=\"application\/ld+json\">\n{\n  \"@context\": \"https:\/\/schema.org\",\n  \"@type\": \"Organization\",\n  \"name\": \"Mobisoft Infotech\",\n  \"url\": \"https:\/\/mobisoftinfotech.com\/\",\n  \"logo\": \"https:\/\/mobisoftinfotech.com\/assets\/images\/MI_Logo.svg\",\n  \"sameAs\": [\n    \"https:\/\/www.facebook.com\/pages\/Mobisoft-Infotech\/131035500270720\",\n    \"https:\/\/twitter.com\/MobisoftInfo\",\n    \"https:\/\/www.instagram.com\/mobisoftinfotech\/\",\n    \"https:\/\/www.youtube.com\/channel\/UCtwuTXKUXFX7k0NSYhsMeTg\",\n    \"https:\/\/www.linkedin.com\/company\/mobisoft-infotech\",\n    \"https:\/\/in.pinterest.com\/mobisoftinfotech\/\",\n    \"https:\/\/github.com\/MobisoftInfotech\"\n  ],\n  \"contactPoint\": [\n    {\n      \"@type\": \"ContactPoint\",\n      \"telephone\": \"+1-855-572-2777\",\n      \"contactType\": \"Customer Service\",\n      \"areaServed\": \"US\",\n      \"availableLanguage\": [\"English\"]\n    },\n    {\n      \"@type\": \"ContactPoint\",\n      \"telephone\": \"+91-858-600-8627\",\n      \"contactType\": \"Customer Service\",\n      \"areaServed\": \"IN\",\n      \"availableLanguage\": [\"English\"]\n    }\n  ]\n}\n<\/script>\n<script type=\"application\/ld+json\">\n{\n    \"@context\": \"https:\/\/schema.org\",\n    \"@type\": \"LocalBusiness\",\n    \"name\": \"Mobisoft Infotech\",\n    \"url\": \"https:\/\/mobisoftinfotech.com\",\n    \"logo\": \"https:\/\/mobisoftinfotech.com\/assets\/images\/mshomepage\/MI_Logo-white.svg\",\n    \"description\": \"Mobisoft Infotech specializes in custom software development and digital solutions.\",\n    \"address\": {\n        \"@type\": \"PostalAddress\",\n        \"streetAddress\": \"5718 Westheimer Rd Suite 1000\",\n        \"addressLocality\": \"Houston\",\n        \"addressRegion\": \"TX\",\n        \"postalCode\": \"77057\",\n        \"addressCountry\": \"USA\"\n    },\n    \"contactPoint\": [{\n        \"@type\": \"ContactPoint\",\n        \"telephone\": \"+1-855-572-2777\",\n        \"contactType\": \"Customer Service\",\n        \"areaServed\": [\"USA\", \"Worldwide\"],\n        \"availableLanguage\": [\"English\"]\n    }],\n    \"sameAs\": [\n        \"https:\/\/www.facebook.com\/pages\/Mobisoft-Infotech\/131035500270720\",\n        \"https:\/\/x.com\/MobisoftInfo\",\n        \"https:\/\/www.linkedin.com\/company\/mobisoft-infotech\",\n        \"https:\/\/in.pinterest.com\/mobisoftinfotech\/\",\n        \"https:\/\/www.instagram.com\/mobisoftinfotech\/\",\n        \"https:\/\/github.com\/MobisoftInfotech\",\n        \"https:\/\/www.behance.net\/MobisoftInfotech\",\n        \"https:\/\/www.youtube.com\/channel\/UCtwuTXKUXFX7k0NSYhsMeTg\"\n    ]\n}\n<\/script>\n<script type=\"application\/ld+json\">\n    [\n    {\n            \"@context\": \"https:\/\/schema.org\",\n            \"@type\": \"ImageObject\",\n            \"contentUrl\": \"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/02\/opensearch-java-client-spring-boot-integration.png\",\n            \"url\": \"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration\",\n            \"name\": \"Using OpenSearch Java Client and Spring Boot for Powerful Search Integration\",\n            \"caption\": \"Integrating OpenSearch with Java and Spring Boot to create scalable and high-performance search solutions for modern applications.\",\n            \"description\": \"This image provides an overview of how to integrate OpenSearch Java Client with Spring Boot to achieve powerful search capabilities for enterprise applications. It explores the benefits of combining these technologies to streamline data retrieval and performance optimization.\",\n            \"license\": \"https:\/\/mobisoftinfotech.com\/terms\",\n            \"acquireLicensePage\": \"https:\/\/mobisoftinfotech.com\/acquire-license\",\n            \"creditText\": \"Mobisoft Infotech\",\n            \"copyrightNotice\": \"Mobisoft Infotech\",\n            \"creator\": {\n                \"@type\": \"Organization\",\n                \"name\": \"Mobisoft Infotech\"\n            },\n            \"thumbnail\": \"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/02\/opensearch-java-client-spring-boot-integration.png\"\n        },\n        {\n            \"@context\": \"https:\/\/schema.org\",\n            \"@type\": \"ImageObject\",\n            \"contentUrl\": \"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/02\/integrate-opensearch-java-spring-boot-guide.png\",\n            \"url\": \"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration\",\n            \"name\": \"Step-by-Step Guide to Integrate OpenSearch with Java and Spring Boot\",\n            \"caption\": \"Learn the steps required to integrate OpenSearch with Java and Spring Boot in this detailed guide for developers.\",\n            \"description\": \"This image illustrates a tutorial for developers, walking them through the process of integrating OpenSearch with Java and Spring Boot. This practical guide helps enhance search performance and scalability for enterprise-level applications.\",\n            \"license\": \"https:\/\/mobisoftinfotech.com\/terms\",\n            \"acquireLicensePage\": \"https:\/\/mobisoftinfotech.com\/acquire-license\",\n            \"creditText\": \"Mobisoft Infotech\",\n            \"copyrightNotice\": \"Mobisoft Infotech\",\n            \"creator\": {\n                \"@type\": \"Organization\",\n                \"name\": \"Mobisoft Infotech\"\n            },\n            \"thumbnail\": \"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/02\/integrate-opensearch-java-spring-boot-guide.png\"\n        },\n        {\n            \"@context\": \"https:\/\/schema.org\",\n            \"@type\": \"ImageObject\",\n            \"contentUrl\": \"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/02\/opensearch-java-spring-boot-architecture.png\",\n            \"url\": \"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration\",\n            \"name\": \"Architecture Diagram for OpenSearch Java Client and Spring Boot\",\n            \"caption\": \"A detailed architecture diagram showing the integration of OpenSearch Java Client with Spring Boot for efficient search systems.\",\n            \"description\": \"This architecture diagram highlights the flow of data between OpenSearch and Spring Boot, demonstrating how they work together to create powerful search systems. It\u2019s ideal for CTOs and developers looking for insights into system design for search functionality.\",\n            \"license\": \"https:\/\/mobisoftinfotech.com\/terms\",\n            \"acquireLicensePage\": \"https:\/\/mobisoftinfotech.com\/acquire-license\",\n            \"creditText\": \"Mobisoft Infotech\",\n            \"copyrightNotice\": \"Mobisoft Infotech\",\n            \"creator\": {\n                \"@type\": \"Organization\",\n                \"name\": \"Mobisoft Infotech\"\n            },\n            \"thumbnail\": \"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/02\/opensearch-java-spring-boot-architecture.png\"\n        },\n        {\n            \"@context\": \"https:\/\/schema.org\",\n            \"@type\": \"ImageObject\",\n            \"contentUrl\": \"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/02\/optimize-search-performance-opensearch-java.png\",\n            \"url\": \"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration\",\n            \"name\": \"Optimize Search Performance with OpenSearch and Java\",\n            \"caption\": \"Explore techniques to optimize search performance by fine-tuning OpenSearch and Java for better results.\",\n            \"description\": \"This image provides insights into optimizing search performance with OpenSearch and Java. It includes performance tuning, configuration best practices, and methods to enhance the efficiency of search systems in Java applications.\",\n            \"license\": \"https:\/\/mobisoftinfotech.com\/terms\",\n            \"acquireLicensePage\": \"https:\/\/mobisoftinfotech.com\/acquire-license\",\n            \"creditText\": \"Mobisoft Infotech\",\n            \"copyrightNotice\": \"Mobisoft Infotech\",\n            \"creator\": {\n                \"@type\": \"Organization\",\n                \"name\": \"Mobisoft Infotech\"\n            },\n            \"thumbnail\": \"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/02\/optimize-search-performance-opensearch-java.png\"\n        }\n        ]\n    <\/script>\n<style>\n@media only screen and (max-width:767px){\n.code-custom{\nmargin-left:0px !important;\n}\n.post-content li:before {\n    content: '';\n    width: 9px;\n    height: 9px;\n    background-color: #0d265c;\n    border-radius: 50%;\n    position: absolute;\n    left: 0px;\n    top: 12px;\n}\n.post-content li {\n    padding-left: 25px;\n}\n.post-content p, .post-content li{text-align: left;}}\n\n.code-custom{\nmargin-left:40px;\n}\n.number-list{\n    border-radius: 5px;\n    background-color: #4960e3;\n    font-size: 25px;\n    font-weight: bold;\n    line-height: 1.96;\n    color: #ffffff;\n    padding: 5px 12px;\n    margin-right:4px;\n}\nh4.wp-block-heading {\n    font-size: 22px;\n}\n<\/style>\n\n\n","protected":false},"excerpt":{"rendered":"<p>In today&#8217;s data-driven world, the ability to quickly search, analyze, and visualize vast amounts of information is crucial. Enter OpenSearch, a powerful and versatile open-source suite designed to do just that. But what exactly is OpenSearch, and why should you consider it? Let&#8217;s break it down. What is OpenSearch and How Does the OpenSearch Java [&hellip;]<\/p>\n","protected":false},"author":33,"featured_media":35704,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_s2mail":"","footnotes":""},"categories":[286],"tags":[4786,4778,4787,4793,4792,4783,4780,4779,4790,4789,4781,4784,4782,4791,4785,4788],"class_list":["post-35698","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-elasticsearch-with-spring-boot","tag-java-opensearch-client","tag-opensearch-configuration","tag-opensearch-example","tag-opensearch-java","tag-opensearch-java-client","tag-opensearch-java-client-example","tag-opensearch-java-sdk","tag-opensearch-performance-tuning","tag-opensearch-setup","tag-opensearch-spring-data","tag-opensearch-tutorial","tag-opensearch-vs-elasticsearch","tag-spring-boot-opensearch","tag-spring-data-elasticsearch","tag-spring-data-opensearch"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>OpenSearch Java Client &amp; Spring Boot Integration Guide<\/title>\n<meta name=\"description\" content=\"Learn how to integrate OpenSearch Java Client with Spring Boot for powerful search functionality and performance tuning in your application.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"OpenSearch Java Client &amp; Spring Boot Integration Guide\" \/>\n<meta property=\"og:description\" content=\"Learn how to integrate OpenSearch Java Client with Spring Boot for powerful search functionality and performance tuning in your application.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration\" \/>\n<meta property=\"og:site_name\" content=\"Mobisoft Infotech\" \/>\n<meta property=\"article:published_time\" content=\"2025-02-27T05:03:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-15T11:34:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/02\/og-Using-OpenSearch-Java-Client-and-Spring-Boot-for-Powerful-Search-Integration.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"525\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Pratik Kale\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Pratik Kale\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration#article\",\"isPartOf\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration\"},\"author\":{\"name\":\"Pratik Kale\",\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/#\/schema\/person\/2f899ff1e21eb491a5f00b67729a2e79\"},\"headline\":\"Using OpenSearch Java Client and Spring Boot for Powerful Search Integration\",\"datePublished\":\"2025-02-27T05:03:22+00:00\",\"dateModified\":\"2025-10-15T11:34:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration\"},\"wordCount\":1055,\"image\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration#primaryimage\"},\"thumbnailUrl\":\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/02\/opensearch-java-client-spring-boot-integration.png\",\"keywords\":[\"elasticsearch with spring boot\",\"java opensearch client\",\"opensearch configuration\",\"opensearch example\",\"opensearch java\",\"opensearch java client\",\"OpenSearch java client example\",\"opensearch java sdk\",\"opensearch performance tuning\",\"opensearch setup\",\"opensearch spring data\",\"opensearch tutorial\",\"opensearch vs elasticsearch\",\"spring boot opensearch\",\"spring data elasticsearch\",\"spring data opensearch\"],\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration\",\"url\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration\",\"name\":\"OpenSearch Java Client & Spring Boot Integration Guide\",\"isPartOf\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration#primaryimage\"},\"image\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration#primaryimage\"},\"thumbnailUrl\":\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/02\/opensearch-java-client-spring-boot-integration.png\",\"datePublished\":\"2025-02-27T05:03:22+00:00\",\"dateModified\":\"2025-10-15T11:34:14+00:00\",\"author\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/#\/schema\/person\/2f899ff1e21eb491a5f00b67729a2e79\"},\"description\":\"Learn how to integrate OpenSearch Java Client with Spring Boot for powerful search functionality and performance tuning in your application.\",\"breadcrumb\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration#primaryimage\",\"url\":\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/02\/opensearch-java-client-spring-boot-integration.png\",\"contentUrl\":\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/02\/opensearch-java-client-spring-boot-integration.png\",\"width\":855,\"height\":392,\"caption\":\"Using OpenSearch Java Client and Spring Boot for powerful search integration\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/mobisoftinfotech.com\/resources\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using OpenSearch Java Client and Spring Boot for Powerful Search Integration\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/#website\",\"url\":\"https:\/\/mobisoftinfotech.com\/resources\/\",\"name\":\"Mobisoft Infotech\",\"description\":\"Discover Mobility\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/mobisoftinfotech.com\/resources\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/#\/schema\/person\/2f899ff1e21eb491a5f00b67729a2e79\",\"name\":\"Pratik Kale\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/4ab83fc5d7dba2e33a8a8363a9c6c833ab3199784b38145b54cd434d49c2092d?s=96&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/4ab83fc5d7dba2e33a8a8363a9c6c833ab3199784b38145b54cd434d49c2092d?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/4ab83fc5d7dba2e33a8a8363a9c6c833ab3199784b38145b54cd434d49c2092d?s=96&r=g\",\"caption\":\"Pratik Kale\"},\"sameAs\":[\"http:\/\/www.mobisoftinfotech.com\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"OpenSearch Java Client & Spring Boot Integration Guide","description":"Learn how to integrate OpenSearch Java Client with Spring Boot for powerful search functionality and performance tuning in your application.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration","og_locale":"en_US","og_type":"article","og_title":"OpenSearch Java Client & Spring Boot Integration Guide","og_description":"Learn how to integrate OpenSearch Java Client with Spring Boot for powerful search functionality and performance tuning in your application.","og_url":"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration","og_site_name":"Mobisoft Infotech","article_published_time":"2025-02-27T05:03:22+00:00","article_modified_time":"2025-10-15T11:34:14+00:00","og_image":[{"width":1000,"height":525,"url":"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/02\/og-Using-OpenSearch-Java-Client-and-Spring-Boot-for-Powerful-Search-Integration.png","type":"image\/png"}],"author":"Pratik Kale","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Pratik Kale","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration#article","isPartOf":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration"},"author":{"name":"Pratik Kale","@id":"https:\/\/mobisoftinfotech.com\/resources\/#\/schema\/person\/2f899ff1e21eb491a5f00b67729a2e79"},"headline":"Using OpenSearch Java Client and Spring Boot for Powerful Search Integration","datePublished":"2025-02-27T05:03:22+00:00","dateModified":"2025-10-15T11:34:14+00:00","mainEntityOfPage":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration"},"wordCount":1055,"image":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration#primaryimage"},"thumbnailUrl":"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/02\/opensearch-java-client-spring-boot-integration.png","keywords":["elasticsearch with spring boot","java opensearch client","opensearch configuration","opensearch example","opensearch java","opensearch java client","OpenSearch java client example","opensearch java sdk","opensearch performance tuning","opensearch setup","opensearch spring data","opensearch tutorial","opensearch vs elasticsearch","spring boot opensearch","spring data elasticsearch","spring data opensearch"],"articleSection":["Blog"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration","url":"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration","name":"OpenSearch Java Client & Spring Boot Integration Guide","isPartOf":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/#website"},"primaryImageOfPage":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration#primaryimage"},"image":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration#primaryimage"},"thumbnailUrl":"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/02\/opensearch-java-client-spring-boot-integration.png","datePublished":"2025-02-27T05:03:22+00:00","dateModified":"2025-10-15T11:34:14+00:00","author":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/#\/schema\/person\/2f899ff1e21eb491a5f00b67729a2e79"},"description":"Learn how to integrate OpenSearch Java Client with Spring Boot for powerful search functionality and performance tuning in your application.","breadcrumb":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration#primaryimage","url":"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/02\/opensearch-java-client-spring-boot-integration.png","contentUrl":"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/02\/opensearch-java-client-spring-boot-integration.png","width":855,"height":392,"caption":"Using OpenSearch Java Client and Spring Boot for powerful search integration"},{"@type":"BreadcrumbList","@id":"https:\/\/mobisoftinfotech.com\/resources\/blog\/opensearch-java-client-spring-boot-search-integration#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/mobisoftinfotech.com\/resources\/"},{"@type":"ListItem","position":2,"name":"Using OpenSearch Java Client and Spring Boot for Powerful Search Integration"}]},{"@type":"WebSite","@id":"https:\/\/mobisoftinfotech.com\/resources\/#website","url":"https:\/\/mobisoftinfotech.com\/resources\/","name":"Mobisoft Infotech","description":"Discover Mobility","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/mobisoftinfotech.com\/resources\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/mobisoftinfotech.com\/resources\/#\/schema\/person\/2f899ff1e21eb491a5f00b67729a2e79","name":"Pratik Kale","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4ab83fc5d7dba2e33a8a8363a9c6c833ab3199784b38145b54cd434d49c2092d?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4ab83fc5d7dba2e33a8a8363a9c6c833ab3199784b38145b54cd434d49c2092d?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4ab83fc5d7dba2e33a8a8363a9c6c833ab3199784b38145b54cd434d49c2092d?s=96&r=g","caption":"Pratik Kale"},"sameAs":["http:\/\/www.mobisoftinfotech.com\/"]}]}},"_links":{"self":[{"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/posts\/35698","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/users\/33"}],"replies":[{"embeddable":true,"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/comments?post=35698"}],"version-history":[{"count":30,"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/posts\/35698\/revisions"}],"predecessor-version":[{"id":44258,"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/posts\/35698\/revisions\/44258"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/media\/35704"}],"wp:attachment":[{"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/media?parent=35698"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/categories?post=35698"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/tags?post=35698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}