org.apache.blur.lucene.search
Class IterablePaging

java.lang.Object
  extended by org.apache.blur.lucene.search.IterablePaging
All Implemented Interfaces:
BlurIterable<org.apache.lucene.search.ScoreDoc,BlurException>

public class IterablePaging
extends Object
implements BlurIterable<org.apache.lucene.search.ScoreDoc,BlurException>

The IterablePaging class allows for easy paging through lucene hits.


Nested Class Summary
static class IterablePaging.ProgressRef
           
static class IterablePaging.TotalHitsRef
           
 
Constructor Summary
IterablePaging(AtomicBoolean running, org.apache.lucene.search.IndexSearcher searcher, org.apache.lucene.search.Query query, int numHitsToCollect, IterablePaging.TotalHitsRef totalHitsRef, IterablePaging.ProgressRef progressRef, boolean runSlow, org.apache.lucene.search.Sort sort, DeepPagingCache deepPagingCache)
           
 
Method Summary
 IterablePaging gather(int gather)
          Only gather up to x number of hits.
 int getTotalHits()
          Gets the total hits of the search.
 BlurIterator<org.apache.lucene.search.ScoreDoc,BlurException> iterator()
          The ScoreDoc iterator.
 IterablePaging progress(IterablePaging.ProgressRef ref)
          Allows for gathering the progress of the paging.
 IterablePaging skipTo(int skipTo)
          Skips the first x number of hits.
 IterablePaging totalHits(IterablePaging.TotalHitsRef ref)
          Allows for gathering of the total hits of this search.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IterablePaging

public IterablePaging(AtomicBoolean running,
                      org.apache.lucene.search.IndexSearcher searcher,
                      org.apache.lucene.search.Query query,
                      int numHitsToCollect,
                      IterablePaging.TotalHitsRef totalHitsRef,
                      IterablePaging.ProgressRef progressRef,
                      boolean runSlow,
                      org.apache.lucene.search.Sort sort,
                      DeepPagingCache deepPagingCache)
               throws BlurException
Throws:
BlurException
Method Detail

getTotalHits

public int getTotalHits()
Gets the total hits of the search.

Returns:
the total hits.

totalHits

public IterablePaging totalHits(IterablePaging.TotalHitsRef ref)
Allows for gathering of the total hits of this search.

Parameters:
ref - IterablePaging.TotalHitsRef.
Returns:
this.

skipTo

public IterablePaging skipTo(int skipTo)
Skips the first x number of hits.

Parameters:
skipTo - the number hits to skip.
Returns:
this.

gather

public IterablePaging gather(int gather)
Only gather up to x number of hits.

Parameters:
gather - the number of hits to gather.
Returns:
this.

progress

public IterablePaging progress(IterablePaging.ProgressRef ref)
Allows for gathering the progress of the paging.

Parameters:
ref - the IterablePaging.ProgressRef.
Returns:
this.

iterator

public BlurIterator<org.apache.lucene.search.ScoreDoc,BlurException> iterator()
                                                                       throws BlurException
The ScoreDoc iterator.

Specified by:
iterator in interface BlurIterable<org.apache.lucene.search.ScoreDoc,BlurException>
Throws:
BlurException


Copyright © 2012-2014 The Apache Software Foundation. All Rights Reserved.