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

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


  }

  protected Pageable getLimitingPageable(final Pageable source, final int limit) {

    if (source == null) {
      return new SolrPageRequest(0, limit);
    }

    return new PageRequest(source.getPageNumber(), source.getPageSize(), source.getSort()) {

      private static final long serialVersionUID = 8100166028148948968L;
View Full Code Here


    @Override
    public Object execute(Query query) {

      if (!isLimiting()) {

        query.setPageRequest(pageable != null ? pageable : new SolrPageRequest(0, (int) count(query)));
        return executeFind(query).getContent();
      }

      if (pageable == null && isLimiting()) {
        return executeFind(query.setPageRequest(new SolrPageRequest(0, getLimit()))).getContent();
      }

      if (getLimit() > 0) {
        if (pageable.getOffset() > getLimit()) {
          return new PageImpl(java.util.Collections.emptyList(), pageable, getLimit());
View Full Code Here

      if (isLimiting()) {

        int limit = getLimit();
        if (pageToUse == null) {
          pageToUse = new SolrPageRequest(0, limit);
        }

        if (limit > 0) {
          if (pageToUse.getOffset() > limit) {
            return new PageImpl(java.util.Collections.emptyList(), pageToUse, limit);
View Full Code Here

      Object result = null;

      if (solrQueryMethod.isCollectionQuery()) {
        Query clone = SimpleQuery.fromQuery(query);
        result = solrOperations.queryForPage(clone.setPageRequest(new SolrPageRequest(0, Integer.MAX_VALUE)),
            solrQueryMethod.getEntityInformation().getJavaType()).getContent();
      }

      if (ClassUtils.isAssignable(Number.class, solrQueryMethod.getReturnedObjectType())) {
        result = solrOperations.count(query);
View Full Code Here

  public Iterable<T> findAll() {
    int itemCount = (int) this.count();
    if (itemCount == 0) {
      return new PageImpl<T>(Collections.<T> emptyList());
    }
    return this.findAll(new SolrPageRequest(0, itemCount));
  }
View Full Code Here

    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

  }

  @Override
  public Iterable<T> findAll(Iterable<ID> ids) {
    org.springframework.data.solr.core.query.Query query = new SimpleQuery(new Criteria(this.idFieldName).in(ids));
    query.setPageRequest(new SolrPageRequest(0, (int) count(query)));

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

   * @see DATASOLR-112
   */
  @Test
  public void pageableUsingZeroShouldBeParsedCorrectlyWhenSetUsingPageable() {

    SimpleQuery query = new SimpleQuery("*:*").setPageRequest(new SolrPageRequest(0, 0));
    assertPaginationPresent(queryParser.constructSolrQuery(query), 0, 0);
  }
View Full Code Here

    created.setLastModified(new Date());
    created.setWeight(10F);

    repo.save(created);

    StatsPage<ProductBean> statsPage = repo.findAllWithStats(new SolrPageRequest(0, 0));

    FieldStatsResult id = statsPage.getFieldStatsResult("id");
    FieldStatsResult price = statsPage.getFieldStatsResult("price");
    FieldStatsResult weight = statsPage.getFieldStatsResult("weight");
View Full Code Here

TOP

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

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.