Skip to content

Commit 9fbc09a

Browse files
Vrryoutzolov
authored andcommitted
Replace manual bean configuration with application.yml configuration.
1 parent 3b79a1a commit 9fbc09a

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

spring-ai-docs/src/main/antora/modules/ROOT/pages/api/vectordbs/elasticsearch.adoc

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,22 +79,16 @@ dependencies {
7979
TIP: Refer to the xref:getting-started.adoc#dependency-management[Dependency Management] section to add the Spring AI BOM to your build file.
8080
Refer to the xref:getting-started.adoc#repositories[Repositories] section to add Milestone and/or Snapshot Repositories to your build file.
8181

82-
To connect to Elasticsearch, create a `RestClient` bean and provide the access details for your instance.
83-
84-
[source,java]
85-
----
86-
@Bean
87-
public RestClient restClient() {
88-
return RestClient.builder(HttpHost.create("http://localhost:9200"))
89-
.build();
90-
}
91-
----
92-
93-
Next, you can provide the `ElasticsearchVectorStore` configuration via Spring Boot's `application.yml`:
82+
To connect to and configure Elasticsearch, you need to provide access details for your instance.
83+
A simple configuration can either be provided via Spring Boot's `application.yml`
9484

9585
[source,yaml]
9686
----
9787
spring:
88+
elasticsearch:
89+
uris: <elasticsearch instance URIs>
90+
username: <elasticsearch username>
91+
password: <elasticsearch password>
9892
ai:
9993
vectorstore:
10094
elasticsearch:

0 commit comments

Comments
 (0)