问题
Does Spring Data Elastic Search template support username and password? What are the options to if we need to use spring data to connect to elastic search that is protected with Shield.
Current configuration
<elasticsearch:transport-client id="client" cluster-nodes="${elasticsearch.cluster.host}:${elasticsearch.cluster.port}"
cluster-name="${elasticsearch.cluster.name}" />
<bean name="elasticsearchTemplate" class="org.springframework.data.elasticsearch.core.ElasticsearchTemplate">
<constructor-arg name="client" ref="client"/>
</bean>
回答1:
I don't think this is currently being supported, but there is an open pull request for this feature: https://github.com/spring-projects/spring-data-elasticsearch/pull/152
来源:https://stackoverflow.com/questions/33442604/spring-data-elastic-search-with-shield