mirror of https://github.com/apache/lucene.git
LUCENE-5487: throw OUE from FakeScorer.getWeight
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene5487@1576096 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e7acdf3129
commit
d1ddcfa7c1
|
@ -153,6 +153,11 @@ final class BooleanScorer extends BulkScorer {
|
|||
public long cost() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Weight getWeight() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
static final class Bucket {
|
||||
|
|
|
@ -805,6 +805,11 @@ public class IndexSearcher {
|
|||
public long cost() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Weight getWeight() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
private final FakeScorer fakeScorer = new FakeScorer();
|
||||
|
|
|
@ -240,6 +240,11 @@ public class TestBooleanScorer extends LuceneTestCase {
|
|||
public long cost() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Weight getWeight() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
/** Throws UOE if Weight.scorer is called */
|
||||
|
|
|
@ -661,6 +661,11 @@ class DrillSidewaysScorer extends BulkScorer {
|
|||
public Collection<ChildScorer> getChildren() {
|
||||
return Collections.singletonList(new ChildScorer(baseScorer, "MUST"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Weight getWeight() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
static class DocsAndCost implements Comparable<DocsAndCost> {
|
||||
|
|
|
@ -22,8 +22,8 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.lucene.facet.FacetsCollector;
|
||||
import org.apache.lucene.facet.FacetsCollector.MatchingDocs;
|
||||
import org.apache.lucene.facet.FacetsCollector;
|
||||
import org.apache.lucene.facet.FacetsConfig;
|
||||
import org.apache.lucene.index.AtomicReaderContext;
|
||||
import org.apache.lucene.queries.function.FunctionValues;
|
||||
|
@ -31,6 +31,7 @@ import org.apache.lucene.queries.function.ValueSource;
|
|||
import org.apache.lucene.queries.function.docvalues.DoubleDocValues;
|
||||
import org.apache.lucene.search.DocIdSetIterator;
|
||||
import org.apache.lucene.search.Scorer;
|
||||
import org.apache.lucene.search.Weight;
|
||||
import org.apache.lucene.util.IntsRef;
|
||||
|
||||
/** Aggregates sum of values from {@link
|
||||
|
@ -70,6 +71,11 @@ public class TaxonomyFacetSumValueSource extends FloatTaxonomyFacets {
|
|||
@Override public int nextDoc() throws IOException { throw new UnsupportedOperationException(); }
|
||||
@Override public int advance(int target) throws IOException { throw new UnsupportedOperationException(); }
|
||||
@Override public long cost() { return 0; }
|
||||
|
||||
@Override
|
||||
public Weight getWeight() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
private final void sumValues(List<MatchingDocs> matchingDocs, boolean keepScores, ValueSource valueSource) throws IOException {
|
||||
|
|
|
@ -90,7 +90,7 @@ public class BlockGroupingCollector extends Collector {
|
|||
int doc;
|
||||
|
||||
public FakeScorer() {
|
||||
super((Weight) null);
|
||||
super(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -122,6 +122,11 @@ public class BlockGroupingCollector extends Collector {
|
|||
public long cost() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Weight getWeight() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
private static final class OneGroup {
|
||||
|
|
|
@ -242,6 +242,11 @@ class TermsIncludingScoreQuery extends Query {
|
|||
public long cost() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Weight getWeight() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
// This impl assumes that the 'join' values are used uniquely per doc per field. Used for one to many relations.
|
||||
|
|
|
@ -331,7 +331,7 @@ public class ToParentBlockJoinCollector extends Collector {
|
|||
int doc;
|
||||
|
||||
public FakeScorer() {
|
||||
super((Weight) null);
|
||||
super(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -363,6 +363,11 @@ public class ToParentBlockJoinCollector extends Collector {
|
|||
public long cost() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Weight getWeight() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
private OneGroup[] sortedGroups;
|
||||
|
|
Loading…
Reference in New Issue