Package org.springframework.data.solr.core

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


  @Override
  @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());
      }
View Full Code Here


    public RepositoryQuery resolveQuery(Method method, RepositoryMetadata metadata, NamedQueries namedQueries) {

      SolrQueryMethod queryMethod = new SolrQueryMethod(method, metadata, entityInformationCreator);
      String namedQueryName = queryMethod.getNamedQueryName();

      SolrOperations solrOperations = selectSolrOperations(metadata);

      if (namedQueries.hasQuery(namedQueryName)) {
        String namedQuery = namedQueries.getQuery(namedQueryName);
        return new StringBasedSolrQuery(namedQuery, queryMethod, solrOperations);
      } else if (queryMethod.hasAnnotatedQuery()) {
View Full Code Here

        return new PartTreeSolrQuery(queryMethod, solrOperations);
      }
    }

    private SolrOperations selectSolrOperations(RepositoryMetadata metadata) {
      SolrOperations ops = templateHolder.getSolrOperations(metadata.getDomainType());
      if (ops == null) {
        ops = solrOperations;
      }
      return ops;
    }
View Full Code Here

   * (non-Javadoc)
   * @see org.springframework.data.repository.cdi.CdiRepositoryBean#create(javax.enterprise.context.spi.CreationalContext, java.lang.Class, java.lang.Object)
   */
  @Override
  protected T create(CreationalContext<T> creationalContext, Class<T> repositoryType, Object customImplementation) {
    SolrOperations solrOperations = getDependencyInstance(solrOperationsBean, SolrOperations.class);
    return new SolrRepositoryFactory(solrOperations).getRepository(repositoryType, customImplementation);
  }
View Full Code Here

    // remove everything to avoid conflicts with other tests in case server not shut down properly
    deleteAll();
  }

  private void deleteAll() {
    SolrOperations template;
    try {
      template = createSolrTemplate();
      template.delete(new SimpleQuery(new SimpleStringCriteria("*:*")));
      template.commit();
    } catch (IOException e) {
      throw new RuntimeException(e);
    } catch (ParserConfigurationException e) {
      throw new RuntimeException(e);
    } catch (SAXException e) {
View Full Code Here

TOP

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

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.