protected synchronized void indexSearcherUpdate() {

        IndexSearcher oldSearcher = m_indexSearcher;
        if ((oldSearcher != null) && (oldSearcher.getIndexReader() != null)) {
            // in case there is an index searcher available close it
            try {
                if (oldSearcher.getIndexReader() instanceof DirectoryReader) {
                    IndexReader newReader = DirectoryReader.openIfChanged(
                        (DirectoryReader)oldSearcher.getIndexReader());
                    if (newReader != null) {
                        m_indexSearcher = new IndexSearcher(newReader);
                        m_indexSearcher.setSimilarity(m_sim);
                        indexSearcherClose(oldSearcher);
                    }
                }
            } catch (Exception e) {
                LOG.error(Messages.get().getBundle().key(Messages.ERR_INDEX_SEARCHER_REOPEN_1, getName()), e);
            }
        } else {
            // make sure we end up with an open index searcher / reader
            indexSearcherOpen(getPath());
        }
    }
protected synchronized void indexSearcherUpdate ( ) { IndexSearcher oldSearcher = m_indexSearcher ; if ( ( oldSearcher != null ) && ( oldSearcher . getIndexReader ( ) != null ) ) { try { if ( oldSearcher . getIndexReader ( ) instanceof DirectoryReader ) { IndexReader newReader = DirectoryReader . openIfChanged ( ( DirectoryReader ) oldSearcher . getIndexReader ( ) ) ; if ( newReader != null ) { m_indexSearcher = new IndexSearcher ( newReader ) ; m_indexSearcher . setSimilarity ( m_sim ) ; indexSearcherClose ( oldSearcher ) ; } } } catch ( Exception e ) { LOG . error ( Messages . get ( ) . getBundle ( ) . key ( Messages . ERR_INDEX_SEARCHER_REOPEN_1 , getName ( ) ) , e ) ; } } else { indexSearcherOpen ( getPath ( ) ) ; } }
Reopens the index search reader for this index, required after the index has been changed.<p>

@see #indexSearcherOpen(String)