From 29821baed6416aad395036452f675e234a108e72 Mon Sep 17 00:00:00 2001 From: Steven Date: Mon, 27 Jul 2026 18:51:28 +0100 Subject: [PATCH] New Doc section on Server Type Original Pull Request: #3320 Signed-off-by: Stexxen --- .../ROOT/pages/elasticsearch/clients.adoc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/main/antora/modules/ROOT/pages/elasticsearch/clients.adoc b/src/main/antora/modules/ROOT/pages/elasticsearch/clients.adoc index a44ea3649..dca63f6d6 100644 --- a/src/main/antora/modules/ROOT/pages/elasticsearch/clients.adoc +++ b/src/main/antora/modules/ROOT/pages/elasticsearch/clients.adoc @@ -3,7 +3,7 @@ This chapter illustrates configuration and usage of supported Elasticsearch client implementations. -Spring Data Elasticsearch operates upon an Elasticsearch client (provided by Elasticsearch client libraries) that is connected to a single Elasticsearch node or a cluster. +Spring Data Elasticsearch operates upon an Elasticsearch client (provided by Elasticsearch client libraries) that is connected to a single Elasticsearch node, a cluster or Elasticsearch serverless. Although the Elasticsearch Client can be used directly to work with the cluster, applications using Spring Data Elasticsearch normally use the higher level abstractions of xref:elasticsearch/template.adoc[Elasticsearch Operations] and xref:elasticsearch/repositories/elasticsearch-repositories.adoc[Elasticsearch Repositories]. [[elasticsearch.clients.rest5client]] @@ -454,6 +454,22 @@ ClientConfiguration.builder() ---- ==== +[[elasticsearch.clients.servertype]] +== Server Type +There are now 2 types of server that a client could connect to. They are `DEFAULT` which represent all single nodes and clusters; and `SERVERLESS` which represents Elasticsearch new flavour of providing cloud hosted elasticsearch. +If you are going to use Elasticsearch Serverless then you need to specific this so that certain settings are changed and indexes are created correctly. +The javadoc:org.springframework.data.elasticsearch.config.ElasticsearchConfigurationSupport[] class (extended by javadoc:org.springframework.data.elasticsearch.client.elc.ElasticsearchConfiguration[]) allows the overriding of `serverType()`. + +==== +[source,java] +---- +@Override +ElasticsearchServerType serverType() { + return ElasticsearchServerType.SERVERLESS; +} +---- +==== + [[elasticsearch.clients.logging]] == Client Logging