SOLR-8482: add & use QueryCommand.[gs]etTerminateEarly accessors.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1723358 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Christine Poerschke 2016-01-06 16:13:06 +00:00
parent c76b72f448
commit 21ed3b7ffa
2 changed files with 8 additions and 1 deletions

View File

@ -434,6 +434,8 @@ Other Changes
* SOLR-8489: TestMiniSolrCloudCluster.createCollection to support extra & alternative collectionProperties
(Christine Poerschke)
* SOLR-8482: add & use QueryCommand.[gs]etTerminateEarly accessors. (Christine Poerschke)
================== 5.4.0 ==================
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release

View File

@ -190,7 +190,7 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable,SolrIn
private void buildAndRunCollectorChain(QueryResult qr, Query query,
Collector collector, QueryCommand cmd, DelegatingCollector postFilter) throws IOException {
final boolean terminateEarly = (cmd.getFlags() & TERMINATE_EARLY) == TERMINATE_EARLY;
final boolean terminateEarly = cmd.getTerminateEarly();
if (terminateEarly) {
collector = new EarlyTerminatingCollector(collector, cmd.getLen());
}
@ -2556,6 +2556,11 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable,SolrIn
public QueryCommand setNeedDocSet(boolean needDocSet) {
return needDocSet ? setFlags(GET_DOCSET) : clearFlags(GET_DOCSET);
}
public boolean getTerminateEarly() { return (flags & TERMINATE_EARLY) != 0; }
public QueryCommand setTerminateEarly(boolean segmentTerminateEarly) {
return segmentTerminateEarly ? setFlags(TERMINATE_EARLY) : clearFlags(TERMINATE_EARLY);
}
}