Java 类org.apache.lucene.search.CollectionTerminatedException 实例源码

项目:Elasticsearch    文件:ChildrenQuery.java   
@Override
protected boolean match(int doc) {
    if (parentWeight.remaining == 0) {
        throw new CollectionTerminatedException();
    }

    final long parentOrd = ordinals.getOrd(doc);
    if (parentOrd >= 0) {
        final long parentIdx = parentIds.find(parentOrd);
        if (parentIdx != -1) {
            parentWeight.remaining--;
            int count = occurrences.get(parentIdx);
            if (count >= minChildren && count <= maxChildren) {
                return true;
            }
        }
    }
    return false;
}
项目:elasticsearch_my    文件:CompletionSuggester.java   
private static void suggest(IndexSearcher searcher, CompletionQuery query, TopSuggestDocsCollector collector) throws IOException {
    query = (CompletionQuery) query.rewrite(searcher.getIndexReader());
    Weight weight = query.createWeight(searcher, collector.needsScores());
    for (LeafReaderContext context : searcher.getIndexReader().leaves()) {
        BulkScorer scorer = weight.bulkScorer(context);
        if (scorer != null) {
            try {
                scorer.score(collector.getLeafCollector(context), context.reader().getLiveDocs());
            } catch (CollectionTerminatedException e) {
                // collection was terminated prematurely
                // continue with the following leaf
            }
        }
    }
}
项目:elasticsearch_my    文件:CompletionSuggester.java   
@Override
public void collect(int docID, CharSequence key, CharSequence context, float score) throws IOException {
    if (scoreDocMap.containsKey(docID)) {
        SuggestDoc suggestDoc = scoreDocMap.get(docID);
        suggestDoc.add(key, context, score);
    } else if (scoreDocMap.size() <= num) {
        scoreDocMap.put(docID, new SuggestDoc(docBase + docID, key, context, score));
    } else {
        throw new CollectionTerminatedException();
    }
}
项目:Elasticsearch    文件:ScanContext.java   
@Override
public void doSetNextReader(LeafReaderContext context) throws IOException {
    if (docs.size() >= size || context.docBase + context.reader().maxDoc() <= docUpTo) {
        // no need to collect a new segment, we either already collected enough
        // or the segment is not competitive
        throw new CollectionTerminatedException();
    }
    docBase = context.docBase;
}
项目:search    文件:EarlyTerminatingSortingCollector.java   
@Override
public void collect(int doc) throws IOException {
  in.collect(doc);
  if (++numCollected >= segmentTotalCollect) {
    throw new CollectionTerminatedException();
  }
}
项目:read-open-source-code    文件:EarlyTerminatingSortingCollector.java   
@Override
public void collect(int doc) throws IOException {
  in.collect(doc);
  if (++numCollected >= segmentTotalCollect) {
    throw new CollectionTerminatedException();
  }
}
项目:read-open-source-code    文件:EarlyTerminatingSortingCollector.java   
@Override
public void collect(int doc) throws IOException {
  in.collect(doc);
  if (++numCollected >= segmentTotalCollect) {
    throw new CollectionTerminatedException();
  }
}
项目:read-open-source-code    文件:EarlyTerminatingSortingCollector.java   
@Override
public void collect(int doc) throws IOException {
  in.collect(doc);
  if (++numCollected >= segmentTotalCollect) {
    throw new CollectionTerminatedException();
  }
}
项目:Maskana-Gestor-de-Conocimiento    文件:EarlyTerminatingSortingCollector.java   
@Override
public void collect(int doc) throws IOException {
  in.collect(doc);
  if (++numCollected >= segmentTotalCollect) {
    throw new CollectionTerminatedException();
  }
}
项目:neo4j-lucene5-index    文件:FirstHitCollector.java   
@Override
public void collect( int doc ) throws IOException
{
    result = doc;
    throw new CollectionTerminatedException();
}