Currently, the @setting(settingPath = "...") annotation in Spring Data Elasticsearch does not support property placeholders (e.g. ${...}) or SpEL expressions (e.g. #{...}).
This makes it impossible to configure the index settings file dynamically based on the environment (e.g. dev, staging, prod), forcing developers to hardcode the JSON path
@Setting(settingPath = "classpath:elasticsearch/settings-${spring.profile.active}.json")
@Document(indexName = "my-index")
public class MyDocument {
// ...
}
Currently we're forced to either manually create the index, or implement a custom bean to programmatically load and apply the settings, and break the convenience of @setting