private void searchWithTimeLimiter(final Filter luceneFilter,Collector collector) throws IOException {
  if (cmd.getTimeAllowed() > 0) {
    if (timeLimitingCollector == null) {
      timeLimitingCollector=new TimeLimitingCollector(collector,TimeLimitingCollector.getGlobalCounter(),cmd.getTimeAllowed());
    }
 else {
      timeLimitingCollector.setCollector(collector);
    }
    collector=timeLimitingCollector;
  }
  try {
    searcher.search(query,luceneFilter,collector);
  }
 catch (  TimeLimitingCollector.TimeExceededException x) {
    logger.warn("Query: " + query + "; "+ x.getMessage());
    qr.setPartialResults(true);
  }
}

private void searchWithTimeLimiter ( final Filter luceneFilter , Collector collector ) throws IOException { if ( cmd . getTimeAllowed ( ) > 0 ) { if ( timeLimitingCollector == null ) { timeLimitingCollector = new TimeLimitingCollector ( collector , TimeLimitingCollector . getGlobalCounter ( ) , cmd . getTimeAllowed ( ) ) ; } else { timeLimitingCollector . setCollector ( collector ) ; } collector = timeLimitingCollector ; } try { searcher . search ( query , luceneFilter , collector ) ; } catch ( TimeLimitingCollector . TimeExceededException x ) { logger . warn ( "Query: " + query + "; " + x . getMessage ( ) ) ; qr . setPartialResults ( true ) ; } }
invokes search with the specified filter and collector . if a time limit has been specified , wrap the collector in a timelimitingcollector
