Polish contribution
Closes gh-5511
This commit is contained in:
@@ -3214,11 +3214,24 @@ dependencies in a convenient way.
|
||||
[[boot-features-connecting-to-elasticsearch]]
|
||||
==== Connecting to Elasticsearch
|
||||
You can inject an auto-configured `ElasticsearchTemplate` or Elasticsearch `Client`
|
||||
instance as you would any other Spring Bean. By default the instance will attempt to
|
||||
connect to a local in-memory server (a `NodeClient` in Elasticsearch terms), but you can
|
||||
switch to a remote server (i.e. a `TransportClient`) by setting
|
||||
instance as you would any other Spring Bean. By default the instance will embed a
|
||||
local in-memory server (a `Node` in ElasticSearch terms) and use the current working
|
||||
directory as the home directory for the server. In this setup, the first thing to do
|
||||
is to tell ElasticSearch were to store its files:
|
||||
|
||||
[source,properties,indent=0]
|
||||
----
|
||||
spring.data.elasticsearch.properties.path.home=/foo/bar
|
||||
----
|
||||
|
||||
Alternatively, you can switch to a remote server (i.e. a `TransportClient`) by setting
|
||||
`spring.data.elasticsearch.cluster-nodes` to a comma-separated '`host:port`' list.
|
||||
|
||||
[source,properties,indent=0]
|
||||
----
|
||||
spring.data.elasticsearch.cluster-nodes=localhost:9300
|
||||
----
|
||||
|
||||
[source,java,indent=0]
|
||||
----
|
||||
@Component
|
||||
|
||||
Reference in New Issue
Block a user