Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions solr/core/src/java/org/apache/solr/search/FunctionRangeQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.apache.lucene.search.QueryVisitor;
import org.apache.lucene.search.ScoreMode;
import org.apache.lucene.search.Weight;
import org.apache.solr.common.SolrException;
import org.apache.solr.search.function.ValueSourceRangeFilter;

// This class works as either an ExtendedQuery, or as a PostFilter using a collector
Expand All @@ -50,24 +49,16 @@ public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float bo
@Override
public DelegatingCollector getFilterCollector(IndexSearcher searcher) {
Map<Object, Object> fcontext = ValueSource.newContext(searcher);
Weight weight = null;
try {
weight = rangeFilt.createWeight(searcher, ScoreMode.COMPLETE, 1);
} catch (IOException e) {
throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e);
}
return new FunctionRangeCollector(fcontext, weight);
return new FunctionRangeCollector(fcontext);
}

class FunctionRangeCollector extends DelegatingCollector {
final Map<Object, Object> fcontext;
final Weight weight;
ValueSourceScorer valueSourceScorer;
int maxdoc;

public FunctionRangeCollector(Map<Object, Object> fcontext, Weight weight) {
public FunctionRangeCollector(Map<Object, Object> fcontext) {
this.fcontext = fcontext;
this.weight = weight;
}

@Override
Expand Down