问题
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=
?
回答1:
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
来源:https://stackoverflow.com/questions/25687545/control-elasticsearch-configuration-in-spring-data-setup