SOLR-5020: add DelegatingCollector.final()

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1501376 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2013-07-09 16:54:55 +00:00
parent 2734af0c56
commit fd914505ea
2 changed files with 22 additions and 0 deletions

View File

@ -75,5 +75,11 @@ public class DelegatingCollector extends Collector {
public boolean acceptsDocsOutOfOrder() {
return delegate.acceptsDocsOutOfOrder();
}
public void finish() throws IOException {
if(delegate instanceof DelegatingCollector) {
((DelegatingCollector) delegate).finish();
}
}
}

View File

@ -913,6 +913,10 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable,SolrIn
}
}
if(collector instanceof DelegatingCollector) {
((DelegatingCollector) collector).finish();
}
return setCollector.getDocSet();
}
@ -1457,6 +1461,9 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable,SolrIn
try {
super.search(query, luceneFilter, collector);
if(collector instanceof DelegatingCollector) {
((DelegatingCollector)collector).finish();
}
}
catch( TimeLimitingCollector.TimeExceededException x ) {
log.warn( "Query: " + query + "; " + x.getMessage() );
@ -1493,6 +1500,9 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable,SolrIn
}
try {
super.search(query, luceneFilter, collector);
if(collector instanceof DelegatingCollector) {
((DelegatingCollector)collector).finish();
}
}
catch( TimeLimitingCollector.TimeExceededException x ) {
log.warn( "Query: " + query + "; " + x.getMessage() );
@ -1585,6 +1595,9 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable,SolrIn
try {
super.search(query, luceneFilter, collector);
if(collector instanceof DelegatingCollector) {
((DelegatingCollector)collector).finish();
}
}
catch( TimeLimitingCollector.TimeExceededException x ) {
log.warn( "Query: " + query + "; " + x.getMessage() );
@ -1622,6 +1635,9 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable,SolrIn
}
try {
super.search(query, luceneFilter, collector);
if(collector instanceof DelegatingCollector) {
((DelegatingCollector)collector).finish();
}
}
catch( TimeLimitingCollector.TimeExceededException x ) {
log.warn( "Query: " + query + "; " + x.getMessage() );