Example #1
0
 /// <summary>
 /// Create a new <seealso cref="EarlyTerminatingSortingCollector"/> instance.
 /// </summary>
 /// <param name="in">
 ///          the collector to wrap </param>
 /// <param name="sort">
 ///          the sort you are sorting the search results on </param>
 /// <param name="numDocsToCollect">
 ///          the number of documents to collect on each segment. When wrapping
 ///          a <seealso cref="TopDocsCollector"/>, this number should be the number of
 ///          hits. </param>
 public EarlyTerminatingSortingCollector(Collector @in, Sort sort, int numDocsToCollect)
 {
     if (numDocsToCollect <= 0)
     {
         throw new IllegalStateException("numDocsToCollect must always be > 0, got " + segmentTotalCollect);
     }
     this.@in              = @in;
     this.sort             = sort;
     this.numDocsToCollect = numDocsToCollect;
 }
 /// <summary>
 /// Create a new <seealso cref="EarlyTerminatingSortingCollector"/> instance.
 /// </summary>
 /// <param name="in">
 ///          the collector to wrap </param>
 /// <param name="sort">
 ///          the sort you are sorting the search results on </param>
 /// <param name="numDocsToCollect">
 ///          the number of documents to collect on each segment. When wrapping
 ///          a <seealso cref="TopDocsCollector"/>, this number should be the number of
 ///          hits. </param>
 public EarlyTerminatingSortingCollector(Collector @in, Sort sort, int numDocsToCollect)
 {
     if (numDocsToCollect <= 0)
     {
       throw new IllegalStateException("numDocsToCollect must always be > 0, got " + segmentTotalCollect);
     }
     this.@in = @in;
     this.sort = sort;
     this.numDocsToCollect = numDocsToCollect;
 }