Mercurial Hosting > luan
comparison src/goodjava/lucene/api/GoodCollector.java @ 1460:3ab0d043370f
start lucene.api
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 23 Mar 2020 00:04:42 -0600 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1459:b04b8fc5f4f4 | 1460:3ab0d043370f |
---|---|
1 package goodjava.lucene.api; | |
2 | |
3 import java.io.IOException; | |
4 import org.apache.lucene.index.AtomicReaderContext; | |
5 import org.apache.lucene.search.Collector; | |
6 import org.apache.lucene.search.Scorer; | |
7 | |
8 | |
9 public abstract class GoodCollector extends Collector { | |
10 private int docBase; | |
11 | |
12 public boolean acceptsDocsOutOfOrder() { | |
13 return true; | |
14 } | |
15 | |
16 public void setScorer(Scorer scorer) {} | |
17 | |
18 public void setNextReader(AtomicReaderContext context) { | |
19 this.docBase = context.docBase; | |
20 } | |
21 | |
22 public void collect(int doc) throws IOException { | |
23 collectDoc(docBase+doc); | |
24 } | |
25 | |
26 public abstract void collectDoc(int doc) throws IOException; | |
27 } |