I use this annotation provided by spring-starter-elastic-search to create the document, and I would like to dynamically enter the indexname parameter:
@Entity @Document(indexName = "myindex") public class StockQuotation
In another bean, I successfully did this using @Value in a field:
@Value("${elasticsearch.index.name}") public String indexName;
However, I tried to enter it also in the annotation, and the translation failed:
@Entity @Document(indexName = "${elasticsearch.index.name}") public class StockQuotation
How do I get this exception:
Caused by: org.elasticsearch.indices.IndexMissingException: [${elasticsearch.index.name}] missing
What would be the appropriate approach for this?
thanks
source share