我的問題類似於[1] 我有一個spring啓動應用程序,我在elasticsearch中保存了一些文檔。索引每次都在當前目錄的數據目錄中創建。我想將此默認路徑更改爲給定路徑。我怎樣才能做到這一點?如此簡單的任務需要數小時才能找到。如何使用Spring Boot設置ElasticSearch的數據目錄
我試了很多東西:
@Setting(setting="/data/elasticsearch")
- 在elasticseacrh.properties和
application.properties
文件:path.data
spring.data.elasticsearch.path.data
沒有任何運氣。
使用Spring 1.3.0引導的根目錄應用程序的環境中創建的路徑,和「spring.data.elasticsearch.properties.data.path」或「spring.data.elasticsearch.properties.path.data」不工作......這是真的支持嗎?在這個問題上沒有找到像樣的答案。 –
目前我使用的是spring boot 2.6。在我的應用程序/屬性文件位於資源文件夾我有設置spring.data.elasticsearch.properties.path.data和它的工作 – ArisRe82
yaml配置沒有爲我工作,但.properties文件配置工作。 –