mirror of
https://github.com/twitter/the-algorithm.git
synced 2024-06-01 08:48:46 +02:00
ef4c5eb65e
Please note we have force-pushed a new initial commit in order to remove some publicly-available Twitter user information. Note that this process may be required in the future.
37 lines
733 B
Java
37 lines
733 B
Java
package com.twitter.search.common.query;
|
|
|
|
import java.io.IOException;
|
|
|
|
import org.apache.lucene.search.DocIdSetIterator;
|
|
import org.apache.lucene.search.Scorer;
|
|
import org.apache.lucene.search.Weight;
|
|
|
|
public class FilteredScorer extends Scorer {
|
|
protected final Scorer inner;
|
|
|
|
public FilteredScorer(Weight weight, Scorer inner) {
|
|
super(weight);
|
|
this.inner = inner;
|
|
}
|
|
|
|
@Override
|
|
public float score() throws IOException {
|
|
return inner.score();
|
|
}
|
|
|
|
@Override
|
|
public int docID() {
|
|
return inner.docID();
|
|
}
|
|
|
|
@Override
|
|
public DocIdSetIterator iterator() {
|
|
return inner.iterator();
|
|
}
|
|
|
|
@Override
|
|
public float getMaxScore(int upTo) throws IOException {
|
|
return inner.getMaxScore(upTo);
|
|
}
|
|
}
|