public int numHits(String query) throws ParseException, IOException {
  Integer count;
  if ((count=(Integer)m_hitCountCache.get(query)) == null) {
    Hits hits=search(query);
    count=new Integer(hits.length());
    m_hitCountCache.put(query,count);
  }
  return count.intValue();
}

public int numHits ( String query ) throws ParseException , IOException { Integer count ; if ( ( count = ( Integer ) m_hitCountCache . get ( query ) ) == null ) { Hits hits = search ( query ) ; count = new Integer ( hits . length ( ) ) ; m_hitCountCache . put ( query , count ) ; } return count . intValue ( ) ; }
return the result count for the given search query . to allow quick repeated look ups , the hit count is cached ( this cache is cleared whenever a change to the search index occurs ) .
