} catch (Exception ex) {
throw new QueryException("Rewrite-Exception query because too many clauses. Query=" + query);
}
long startTime = System.currentTimeMillis();
int n = SearchServiceImpl.getInstance().getSearchModuleConfig().getMaxHits() + 1;
TopDocs docs = searcher.search(query, n);
long queryTime = System.currentTimeMillis() - startTime;
if (log.isDebug()) log.debug("hits.length()=" + docs.totalHits);
SearchResultsImpl searchResult = new SearchResultsImpl(searcher, docs, query, analyzer, identity, roles, doHighlighting);
searchResult.setQueryTime(queryTime);
searchResult.setNumberOfIndexDocuments(searcher.maxDoc());