mirror of
https://github.com/twitter/the-algorithm.git
synced 2024-12-22 18:21:51 +01:00
Update IdentifiableQueryScorer.java
This commit is contained in:
parent
d4245582a7
commit
e15f5a1b61
@ -25,36 +25,33 @@ public class IdentifiableQueryScorer extends FilteredScorer {
|
||||
|
||||
@Override
|
||||
public DocIdSetIterator iterator() {
|
||||
final DocIdSetIterator superDISI = super.iterator();
|
||||
DocIdSetIterator superIterator = super.iterator();
|
||||
|
||||
return new DocIdSetIterator() {
|
||||
@Override
|
||||
public int docID() {
|
||||
return superDISI.docID();
|
||||
return superIterator.docID();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int nextDoc() throws IOException {
|
||||
int docid = superDISI.nextDoc();
|
||||
if (docid != NO_MORE_DOCS) {
|
||||
attrCollector.collectScorerAttribution(docid, queryId);
|
||||
}
|
||||
return docid;
|
||||
return collectAndReturn(superIterator.nextDoc());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int advance(int target) throws IOException {
|
||||
int docid = superDISI.advance(target);
|
||||
if (docid != NO_MORE_DOCS) {
|
||||
attrCollector.collectScorerAttribution(docid, queryId);
|
||||
}
|
||||
return docid;
|
||||
return collectAndReturn(superIterator.advance(target));
|
||||
}
|
||||
|
||||
@Override
|
||||
public long cost() {
|
||||
return superDISI.cost();
|
||||
return superIterator.cost();
|
||||
}
|
||||
|
||||
private int collectAndReturn(int docId) {
|
||||
if (docId != NO_MORE_DOCS) {
|
||||
attrCollector.collectScorerAttribution(docId, queryId);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user