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

SolrTemplate.saveBean doesn't get the right collection name with PartialUpdate

    Details

    • Type: Bug
    • Status: Investigating
    • Priority: Blocker
    • Resolution: Unresolved
    • Affects Version/s: 2.1.1 (Ingalls SR1)
    • Fix Version/s: None
    • Component/s: Repository
    • Labels:
      None
    • Environment:
      Ubuntu 16.4/JDK 8/Solr 6.0.1
    • Sprint:
      Kay RC1, Kay RC3, Kay GA, Kay SR1, Lovelace M1, Lovelace M2 / M3, Lovelace RC1, Lovelace GA, Lovelace SR1, Moore RC1, Moore RC2, Moore SR1, Moore SR2

      Description

      Hello,

      When I make a PartialUpdate, the SolrTemplate.saveBean method always get partialupdate as collection name. If I force the collection name in SolrTemplate.saveBean and SolrTemplate.commit methods, it seems to do a standard saving instead of partial update.
      This issue appear in a multicore configuration, but I didn't try in a single core configuration.

      The configuration file :

      @Configuration
      @EnableSolrRepositories(basePackages = {"org.lendi.umtapo.solr.repository"}, multicoreSupport = true)
      public class SolrConfig {
          @Resource
          private Environment env;
      
          @Bean
          public SolrClient solrClient() throws Exception {
              String solrHome = env.getRequiredProperty("solr.home");
              EmbeddedSolrServerFactory solrServerFactory = new EmbeddedSolrServerFactory(solrHome);
      
              return solrServerFactory.getSolrClient();
          }
      
          @Bean
          public SolrTemplate solrTemplate() throws Exception {
              return new SolrTemplate(solrClient());
          }
      }
      

      The repository implementation :

      public class SolrBorrowerRepositoryImpl implements SolrBorrowerRepositoryCustom {
          @Autowired
          private SolrTemplate solrTemplate;
      
          @Override
          public void update(BorrowerDocument borrowerDocument) {
              PartialUpdate update = new PartialUpdate("id", borrowerDocument.getId());
              update.setValueOfField("name", borrowerDocument.getName());
      
              this.solrTemplate.saveBean(update);
              this.solrTemplate.commit();
          }
      }
      

        Attachments

          Activity

            People

            • Assignee:
              cstrobl Christoph Strobl
              Reporter:
              Brimborion Charles Guérin-Rouard
              Last updater:
              Christoph Strobl
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: