我正在使用elasticsearch
的spring数据,并使用具有以下elasticsearchtemplate
配置的传输客户端。我想知道如何为elasticsearchtemplate
提供屏蔽用户名和密码。我们可以这样做吗?
<elasticsearch:repositories base-package="edu.mayo.registry.fhir.rest.elasticsearch.repository" />
<elasticsearch:transport-client id="client" client-transport-sniff="true" client-transport-ping-timeout="30s" client-transport-nodes-sampler-interval="30s"
cluster-nodes="hostname:9300" />
<!-- <elasticsearch:node-client id="client" local="true"/> -->
<bean name="elasticsearchTemplate"
class="org.springframework.data.elasticsearch.core.ElasticsearchTemplate">
<constructor-arg name="client" ref="client" />
</bean>