在弹簧数据设置中控制弹性搜索配置 [英] control elasticsearch configuration in spring-data setup
本文介绍了在弹簧数据设置中控制弹性搜索配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
< elasticsearch:node-client id =clientlocal = 真/>
现在我需要更多的控制配置,例如设置索引文件位置。我该如何实现?我可以以某种方式传递参数,还是需要使用环境属性 -Des.config =
指定配置文件位置?
解决方案
您需要在config类中使用@Setting(settingPath =elasticsearch.properties),并在文件中设置path.data属性。
检查我的答案此处
I startup elasticsearch via XML configuration like this:
<elasticsearch:node-client id="client" local="true"/>
Now I need more control on configuration e.g. setting the index files location. How can I achieve this? Can I pass parameter somehow or do I need to specify a config-file location using environment property -Des.config=
?
解决方案
You need to use @Setting(settingPath = "elasticsearch.properties") in your config class and inside the file set the path.data property.
Check my answer here
这篇关于在弹簧数据设置中控制弹性搜索配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文