title: Spring Data Solr multiple cores and repository
body: <p>I have apache solr with multiple cores e.g. currency, country etc... So using Spring Data Solr I can retrieve information from one core. I have got this XML configuration right now queries against <strong>'currency'</strong> core. If I wanted to query against <strong>'country'</strong> core how can I set this up? </p>
  
  <pre><code>&lt;!-- Enable Solr repositories and configure repository base package --&gt;
  &lt;solr:repositories base-package="com.acme.repository" solr-template-ref="solrCurrencyTemplate"/&gt;
  
  &lt;solr:solr-server id="solrCurrencyServer" url="http://localhost:8983/solr/currency"/&gt;
  
  &lt;bean id="solrCurrencyTemplate" class="org.springframework.data.solr.core.SolrTemplate"&gt;
      &lt;constructor-arg ref="solrCurrencyServer" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>and have the repository defined as</p>
  
  <pre><code>@Repository
  public interface CurrencyRepository extends SolrCrudRepository&lt;Currency, String&gt; {
  
  }
  </code></pre>
  
  <p>and from my service I can do this</p>
  
  <pre><code>@Override
  public List&lt;Currency&gt; getCurrencies() {
      Page&lt;Currency&gt; currencies = (Page&lt;Currency&gt;) currencyRepository.findAll();
      return currencies.getContent();
  }
  </code></pre>
  
  <p>I have also tried using <strong>@SolrDocument(solrCoreName = "currency")</strong> but this din't work.</p>
  
  <pre><code>@SolrDocument(solrCoreName = "currency")
  public class Currency {
      public static final String FIELD_CURRENCY_NAME = "currency_name";
      public static final String FIELD_CURRENCY_CODE = "currency_code";
      public static final String FIELD_DECIMALS = "decimals";
  
      @Id
      @Field(value = FIELD_CURRENCY_CODE)
      private String currencyCode;
  
      //currency_name,decimals
      @Field(value = FIELD_CURRENCY_NAME)
      private String currencyName;
  
      @Field(value = FIELD_DECIMALS)
      private String decimals;
  
  ...
  ...
  ...
  }
  </code></pre>
  
  <p>I need help on this asap... otherwise I will have to go back to the RestTemplate Solution :-(</p>
  
  <p>Hope someone can help.
  Thanks
  GM</p>