diff --git a/persistence-modules/spring-data-elasticsearch-2/pom.xml b/persistence-modules/spring-data-elasticsearch-2/pom.xml
new file mode 100644
index 000000000000..9c0656d03aa1
--- /dev/null
+++ b/persistence-modules/spring-data-elasticsearch-2/pom.xml
@@ -0,0 +1,212 @@
+
+ 4.0.0
+ spring-data-elasticsearch
+ spring-data-elasticsearch
+ jar
+
+
+ com.baeldung
+ parent-boot-3
+ 0.0.1-SNAPSHOT
+ ../../parent-boot-3
+
+
+
+
+ org.springframework.data
+ spring-data-elasticsearch
+ ${spring-data-elasticsearch.version}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ org.elasticsearch.client
+ elasticsearch-rest-high-level-client
+ 7.17.11
+
+
+ org.projectlombok
+ lombok
+ ${lombok.version}
+
+
+ org.springframework.boot
+ spring-boot-autoconfigure
+
+
+ org.apache.commons
+ commons-csv
+ ${commons-csv.version}
+
+
+ org.springframework.boot
+ spring-boot-starter-batch
+ ${spring-boot.version}
+
+
+
+
+ org.testcontainers
+ elasticsearch
+ 1.21.3
+ test
+
+
+
+
+ com.squareup.okhttp3
+ mockwebserver
+ test
+
+
+
+
+ org.elasticsearch
+ elasticsearch
+ ${elasticsearch.version}
+
+
+
+
+ org.elasticsearch.client
+ elasticsearch-rest-client
+ ${elasticsearch.version}
+
+
+
+
+ com.fasterxml.jackson.core
+ jackson-core
+
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-logging
+
+
+
+
+ org.springframework.boot
+ spring-boot-configuration-processor
+ true
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+
+
+ org.springframework.boot
+ spring-boot-testcontainers
+ test
+
+
+
+
+ org.testcontainers
+ junit-jupiter
+ ${testcontainers.version}
+ test
+
+
+
+
+ org.testcontainers
+ elasticsearch
+ ${testcontainers.version}
+ test
+
+
+
+
+ org.testcontainers
+ testcontainers
+ ${testcontainers.version}
+ test
+
+
+
+
+ com.squareup.okhttp3
+ mockwebserver
+ test
+
+
+
+
+ org.assertj
+ assertj-core
+ test
+
+
+
+
+
+
+
+
+
+ org.testcontainers
+ testcontainers-bom
+ ${testcontainers.version}
+ pom
+ import
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+ 17
+ 17
+
+
+
+
+
+
+ 5.1.2
+ 8.9.0
+ 1.12.0
+ 11
+ 11
+ 11
+ UTF-8
+ 8.11.1
+ 1.19.3
+
+
+
\ No newline at end of file
diff --git a/persistence-modules/spring-data-elasticsearch-2/src/main/java/com/baeldung/Application.java b/persistence-modules/spring-data-elasticsearch-2/src/main/java/com/baeldung/Application.java
new file mode 100644
index 000000000000..4ce015efcc23
--- /dev/null
+++ b/persistence-modules/spring-data-elasticsearch-2/src/main/java/com/baeldung/Application.java
@@ -0,0 +1,15 @@
+package com.baeldung;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+
+
+// Exclude DataSource auto-configuration since we're only using Elasticsearch
+@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
+public class Application {
+
+ public static void main(String[] args) {
+ SpringApplication.run(Application.class, args);
+ }
+}
\ No newline at end of file
diff --git a/persistence-modules/spring-data-elasticsearch-2/src/main/java/com/baeldung/wildcardsearch/ElasticsearchConfig.java b/persistence-modules/spring-data-elasticsearch-2/src/main/java/com/baeldung/wildcardsearch/ElasticsearchConfig.java
new file mode 100644
index 000000000000..11290b855098
--- /dev/null
+++ b/persistence-modules/spring-data-elasticsearch-2/src/main/java/com/baeldung/wildcardsearch/ElasticsearchConfig.java
@@ -0,0 +1,32 @@
+package com.baeldung.wildcardsearch;
+
+
+import co.elastic.clients.elasticsearch.ElasticsearchClient;
+import co.elastic.clients.json.jackson.JacksonJsonpMapper;
+import co.elastic.clients.transport.rest_client.RestClientTransport;
+import org.apache.http.HttpHost;
+import org.elasticsearch.client.RestClient;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+public class ElasticsearchConfig {
+
+ @Value("${elasticsearch.host:localhost}")
+ private String host;
+
+ @Value("${elasticsearch.port:9200}")
+ private int port;
+
+ @Bean
+ public RestClient restClient() {
+ return RestClient.builder(new HttpHost(host, port, "http")).setRequestConfigCallback(requestConfigBuilder -> requestConfigBuilder.setConnectTimeout(5000).setSocketTimeout(60000)).setHttpClientConfigCallback(httpClientBuilder -> httpClientBuilder.setMaxConnTotal(100).setMaxConnPerRoute(100)).build();
+ }
+
+ @Bean
+ public ElasticsearchClient elasticsearchClient(RestClient restClient) {
+ RestClientTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper());
+ return new ElasticsearchClient(transport);
+ }
+}
diff --git a/persistence-modules/spring-data-elasticsearch-2/src/main/java/com/baeldung/wildcardsearch/ElasticsearchWildcardService.java b/persistence-modules/spring-data-elasticsearch-2/src/main/java/com/baeldung/wildcardsearch/ElasticsearchWildcardService.java
new file mode 100644
index 000000000000..f7670ce273b6
--- /dev/null
+++ b/persistence-modules/spring-data-elasticsearch-2/src/main/java/com/baeldung/wildcardsearch/ElasticsearchWildcardService.java
@@ -0,0 +1,205 @@
+package com.baeldung.wildcardsearch;
+
+import co.elastic.clients.elasticsearch.ElasticsearchClient;
+import co.elastic.clients.elasticsearch._types.SortOrder;
+import co.elastic.clients.elasticsearch._types.query_dsl.TextQueryType;
+import co.elastic.clients.elasticsearch.core.SearchResponse;
+import co.elastic.clients.elasticsearch.core.search.Hit;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Service
+public class ElasticsearchWildcardService {
+
+ private static final Logger logger = LoggerFactory.getLogger(ElasticsearchWildcardService.class);
+
+ @Autowired
+ private ElasticsearchClient elasticsearchClient;
+
+ @Value("${elasticsearch.max-results:1000}")
+ private int maxResults;
+
+ /**
+ * Performs wildcard search using the new Java API Client
+ * Note: For case-insensitive search, the searchTerm is converted to lowercase
+ * and the field should be mapped with a .keyword subfield or use caseInsensitive flag
+ */
+ public List