Skip to content

Add support for Settings(settingpath) property placeholder or spEL #3187

@ablil

Description

@ablil

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions