I am using spring data for the elasticsearch
and using transport client with the below configuration for elasticsearchtemplate
. I am wondering how we can provide the shield user name and password to the elasticsearchtemplate
. Can we do that?
<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>