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,35 +25,32 @@ public class IdentifiableQueryScorer extends FilteredScorer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DocIdSetIterator iterator() {
|
public DocIdSetIterator iterator() {
|
||||||
final DocIdSetIterator superDISI = super.iterator();
|
DocIdSetIterator superIterator = super.iterator();
|
||||||
|
|
||||||
return new DocIdSetIterator() {
|
return new DocIdSetIterator() {
|
||||||
@Override
|
@Override
|
||||||
public int docID() {
|
public int docID() {
|
||||||
return superDISI.docID();
|
return superIterator.docID();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int nextDoc() throws IOException {
|
public int nextDoc() throws IOException {
|
||||||
int docid = superDISI.nextDoc();
|
return collectAndReturn(superIterator.nextDoc());
|
||||||
if (docid != NO_MORE_DOCS) {
|
|
||||||
attrCollector.collectScorerAttribution(docid, queryId);
|
|
||||||
}
|
|
||||||
return docid;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int advance(int target) throws IOException {
|
public int advance(int target) throws IOException {
|
||||||
int docid = superDISI.advance(target);
|
return collectAndReturn(superIterator.advance(target));
|
||||||
if (docid != NO_MORE_DOCS) {
|
|
||||||
attrCollector.collectScorerAttribution(docid, queryId);
|
|
||||||
}
|
|
||||||
return docid;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long cost() {
|
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