Package org.springframework.data.solr.core

Examples of org.springframework.data.solr.core.SolrTemplate


  }

  private SolrTemplate createTemplate(SolrServer solrServer) {

    SolrTemplate template = new SolrTemplate(solrServer);
    addSchemaCreationFeaturesIfEnabled(template);
    template.afterPropertiesSet();
    return template;
  }
View Full Code Here


  @SuppressWarnings({ "rawtypes", "unchecked" })
  protected Object getTargetRepository(RepositoryMetadata metadata) {

    SolrOperations operations = this.solrOperations;
    if (factory != null) {
      SolrTemplate template = new SolrTemplate(factory);
      if (this.solrOperations.getConverter() != null) {
        template.setMappingContext(this.solrOperations.getConverter().getMappingContext());
      }
      template.setSolrCore(SolrServerUtils.resolveSolrCoreName(metadata.getDomainType()));
      addSchemaCreationFeaturesIfEnabled(template);
      template.afterPropertiesSet();
      operations = template;
    }

    SimpleSolrRepository repository = new SimpleSolrRepository(getEntityInformation(metadata.getDomainType()),
        operations);
View Full Code Here

  public SolrOperations createSolrTemplate() throws IOException, ParserConfigurationException, SAXException {

    EmbeddedSolrServerFactory factory = new EmbeddedSolrServerFactory(ResourceUtils.getURL(
        "classpath:org/springframework/data/solr").getPath());

    SolrTemplate template = new SolrTemplate(factory);
    template.afterPropertiesSet();
    return template;
  }
View Full Code Here

  }

  @Test(expected = IllegalArgumentException.class)
  public void testGetRepositoryOfUnmanageableType() {

    SolrTemplate template = new SolrTemplate(new HttpSolrServer("http://solrserver:8983/solr"), null);
    template.afterPropertiesSet();
    new SolrRepositoryFactory(template).getRepository(UnmanagedEntityRepository.class);
  }
View Full Code Here

  private SolrRepositoryFactory factory;

  @Before
  public void setUp() {
    SolrTemplate template = new SolrTemplate(new HttpSolrServerFactory(solrServer));
    template.afterPropertiesSet();
    factory = new SolrRepositoryFactory(template);
  }
View Full Code Here

  @EnableSolrRepositories
  static class Config {

    @Bean
    public SolrOperations solrTemplate() {
      return new SolrTemplate(solrServer);
    }
View Full Code Here

    Assume.assumeTrue(repository instanceof Advised);

    SimpleSolrRepository simpleSolrRepository = (SimpleSolrRepository) ((Advised) repository).getTargetSource()
        .getTarget();
    SolrTemplate solrTemplate = (SolrTemplate) simpleSolrRepository.getSolrOperations();
    solrTemplate.getSchemaCreationFeatures().contains(Feature.CREATE_MISSING_FIELDS);

    Assert.assertThat(repository, is(notNullValue()));
  }
View Full Code Here

  @EnableSolrRepositories
  static class Config {

    @Bean
    public SolrOperations solrTemplate() {
      return new SolrTemplate(solrServer);
    }
View Full Code Here

  @EnableSolrRepositories
  static class Config {

    @Bean
    public SolrOperations solrTemplate() {
      return new SolrTemplate(solrServer);
    }
View Full Code Here

  private SolrTemplate solrTemplate;

  @Before
  public void setUp() throws IOException, ParserConfigurationException, SAXException {
    solrTemplate = new SolrTemplate(solrServer, null);
    solrTemplate.afterPropertiesSet();
  }
View Full Code Here

TOP

Related Classes of org.springframework.data.solr.core.SolrTemplate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.