{
List<IndexingContext> contexts = getParticipatingContexts( indexingContexts, ignoreContext );
NexusIndexMultiReader multiReader = getMergedIndexReader( indexingContexts, ignoreContext );
NexusIndexMultiSearcher indexSearcher = new NexusIndexMultiSearcher( multiReader );
try
{
TopScoreDocCollector hits = doSearchWithCeiling( request, indexSearcher, request.getQuery() );
return new IteratorSearchResponse( request.getQuery(), hits.getTotalHits(),
new DefaultIteratorResultSet( request, indexSearcher, contexts,
hits.topDocs() ) );
}
catch ( IOException e )
{
try
{
indexSearcher.release();
}
catch ( Exception secondary )
{
// do not mask original exception
}
throw e;
}
catch ( RuntimeException e )
{
try
{
indexSearcher.release();
}
catch ( Exception secondary )
{
// do not mask original exception
}