}
resultList.add(i, result);
}
results = new SearchResultsImpl(resultList);
}
catch (Exception e)
{
log.error("Failed to search. ", e);
}
finally
{
if (searcher != null)
{
try
{
searcher.close();
}
catch (IOException ioe)
{
//logger.error("Closing Searcher", ioe);
}
}
if (indexReader != null)
{
try
{
indexReader.close();
}
catch (IOException ioe)
{
//logger.error("Closing Index Reader", ioe);
}
}
}
return (results != null ? results : new SearchResultsImpl(new ArrayList<ParsedObject>()));
}