@ Nullable public IndexSearcher getSearcher ( ) throws IOException { _checkClosing ( ) ; final IndexReader aReader = getReader ( ) ; if ( aReader == null ) { // Index not readable LOGGER . warn ( "Index not readable" ) ; return null ; } if ( m_aSearchReader == aReader ) { // Reader did not change - use cached searcher assert m_aSearcher != null ; } else { // Create new searcher only if necessary m_aSearchReader = aReader ; m_aSearcher = new IndexSearcher ( aReader ) ; } return m_aSearcher ; }
Get a searcher on this index .