弹簧数据弹性搜索与盾

弹簧数据弹性搜索与盾

本文介绍了弹簧数据弹性搜索与盾的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Spring数据弹性搜索模板是否支持用户名和密码?如果我们需要使用弹簧数据连接到使用Shield保护的弹性搜索,那么可以选择什么。



当前配置

 < elasticsearch:transport -client id =clientcluster-nodes =$ {elasticsearch.cluster.host}:$ {elasticsearch.cluster.port}
cluster-name =$ {elasticsearch.cluster.name}/> ;

< bean name =elasticsearchTemplateclass =org.springframework.data.elasticsearch.core.ElasticsearchTemplate>
< constructor-arg name =clientref =client/>
< / bean>


解决方案

我不认为这是目前的支持,但是有一个开放提示请求:


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>
解决方案

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

这篇关于弹簧数据弹性搜索与盾的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 21:41