Package org.springframework.data.solr.core.query

Examples of org.springframework.data.solr.core.query.SimpleQuery


        new CustomSolrRepositoryImpl(this.solrOperations));
  }

  @After
  public void tearDown() {
    solrOperations.delete(new SimpleQuery(new SimpleStringCriteria("*:*")));
    solrOperations.commit();
  }
 
View Full Code Here


    this.solrTemplate = solrTemplate;
  }

  @Override
  public Page<Product> findProductsByCustomImplementation(String value, Pageable page) {
    return solrTemplate.queryForPage(new SimpleQuery(new SimpleStringCriteria("name:" + value)).setPageRequest(page),
        Product.class);
  }
View Full Code Here

@NoRepositoryBean
public class SolrProductRepository extends SimpleSolrRepository<Product, String> implements ProductRepository {

  @Override
  public Page<Product> findByPopularity(Integer popularity) {
    Query query = new SimpleQuery(new Criteria(SolrSearchableFields.POPULARITY).is(popularity));
    return getSolrOperations().queryForPage(query, Product.class);
  }
View Full Code Here

    return getSolrOperations().queryForFacetPage(query, Product.class);
  }

  @Override
  public Page<Product> findByAvailableTrue() {
    Query query = new SimpleQuery(new Criteria(new SimpleField(Criteria.WILDCARD)).expression(Criteria.WILDCARD));
    query.addFilterQuery(new SimpleQuery(new Criteria(SolrSearchableFields.AVAILABLE).is(true)));

    return getSolrOperations().queryForPage(query, Product.class);
  }
View Full Code Here

    }
  }

  protected SimpleQuery createQueryFromString(String queryString, SolrParameterAccessor parameterAccessor) {
    String parsedQueryString = replacePlaceholders(queryString, parameterAccessor);
    return new SimpleQuery(new SimpleStringCriteria(parsedQueryString));
  }
View Full Code Here

  }

  @Override
  protected Query create(Part part, Iterator<Object> iterator) {
    PersistentPropertyPath<SolrPersistentProperty> path = context.getPersistentPropertyPath(part.getProperty());
    return new SimpleQuery(from(part.getType(),
        new Criteria(path.toDotPath(SolrPersistentProperty.PropertyToFieldNameConverter.INSTANCE)), iterator));
  }
View Full Code Here

    this.rawQueryString = query;
  }

  @Override
  protected Query createQuery(SolrParameterAccessor parameterAccessor) {
    SimpleQuery query = createQueryFromString(this.rawQueryString, parameterAccessor);
    appendProjection(query);
    query.addSort(parameterAccessor.getSort());
    return query;
  }
View Full Code Here

    this.setEntityClass(entityClass);
  }

  @Override
  public T findOne(ID id) {
    return getSolrOperations().queryForObject(new SimpleQuery(new Criteria(this.idFieldName).is(id)), getEntityClass());
  }
View Full Code Here

  }

  @Override
  public Page<T> findAll(Pageable pageable) {
    return getSolrOperations().queryForPage(
        new SimpleQuery(new Criteria(Criteria.WILDCARD).expression(Criteria.WILDCARD)).setPageRequest(pageable),
        getEntityClass());
  }
View Full Code Here

    int itemCount = (int) this.count();
    if (itemCount == 0) {
      return new PageImpl<T>(Collections.<T> emptyList());
    }
    return getSolrOperations().queryForPage(
        new SimpleQuery(new Criteria(Criteria.WILDCARD).expression(Criteria.WILDCARD)).setPageRequest(
            new SolrPageRequest(0, itemCount)).addSort(sort), getEntityClass());
  }
View Full Code Here

TOP

Related Classes of org.springframework.data.solr.core.query.SimpleQuery

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.