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

Dynamically create missing fields for SolrPersistentProperties.

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3 M1 (Evans)
    • Component/s: Core
    • Labels:

      Description

      read solr cores from CoreAdmin and create a MulticoreSolrServerFactory with this information.

      CoreAdminRequest request = new CoreAdminRequest();
      request.setAction(CoreAdminAction.STATUS);
      CoreAdminResponse cores = request.process(solrServer);
      
      // List of the cores
      List<String> coreList = new ArrayList<String>();
      for (int i = 0; i < cores.getCoreStatus().size(); i++) {
          coreList.add(cores.getCoreStatus().getName(i));
      }
      
      SolrServerFatory factory = new MulticoreSolrServerFactory(SolrServer, coreList);
      

      when calling operation on SolrTemplate use type information to retrieve SolrServer for core defined via @SolrDocument.

      SolrServer = factory.getSolrServer(BeanForCollection1.class)
      
      @SolrDocument(core = "collection1")
      public class BeanForCollection1 {
       ....
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                cstrobl Christoph Strobl
                Reporter:
                cstrobl Christoph Strobl
                Last updater:
                Oliver Drotbohm
              • Votes:
                2 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: