Uploaded image for project: 'Spring Data for Apache Solr'
  1. Spring Data for Apache Solr
  2. DATASOLR-304

Allow PropertyPlaceholders in @SolrDocument solrCoreName


    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0.1 (Hopper SR1), 1.5.4 (Gosling SR4)
    • Fix Version/s: None
    • Component/s: Namespace
    • Labels:


      There are situations where the name of a solrCore may change in different environments. Example is a Lower Level Env (LLE) solr cluster that has cores suffixed with _dev _qa _stage, etc.

      As a developer, have the ability to use PropertyPlaceholders in solrCoreName attribute of the @SolrDocument Annotation.

      @SolrDocument(solrCoreName = "${solr.job.core}")
      public class JobDocument {
      	private String guid;
      	private String jobTitle;
      	private String description;
      	public String getGuid() {
      		return guid;
      	public void setGuid(String guid) {
      		this.guid = guid;
      	public String getJobTitle() {
      		return jobTitle;
      	public void setJobTitle(String jobTitle) {
      		this.jobTitle = jobTitle;
      	public String getDescription() {
      		return description;
      	public void setDescription(String description) {
      		this.description = description;

      My attempts to do this with the latest Gosling SR4 and Hopper SR1 yields the following error that leads me to believe this is not currently supported and warrants an improvement request.

      org.apache.solr.common.SolrException: Collection not found: ${solr.job.core}


          Issue Links



              • Assignee:
                cstrobl Christoph Strobl
                dwebb David Webb
                Last updater:
                yoyo tom
              • Votes:
                11 Vote for this issue
                10 Start watching this issue


                • Created: