private static void closeSearcher(IndexSearcher searcher) { IndexReader indexReader = searcher.getIndexReader(); try { searcher.close(); } catch(IOException ignore) {/**/} try { indexReader.close(); } catch(IOException ignore) {/**/} } }
private void closeSearcher(final IndexSearcher searcher) throws IOException { if (searcher != null) { searcher.close(); } } }
@Override public void close() throws IOException { searcher.close(); }
public void closeQuietly(final IndexSearcher issueSearcher) { if (issueSearcher != null) { try { issueSearcher.close(); } catch (IOException e) { // ignore } } }
@Override public void close() throws IOException { super.close(); if(reader != null) { reader.close(); } }
@Override public void close() throws IOException { super.close(); if(reader != null) { reader.close(); } }
//Assume I have an IndexWriter named indexwriter, which I reuse. IndexSearcher searcher = new IndexSearcher(IndexReader.open(indexwriter, true)); //Use the searcher searcher.close(); //We close the search, but the underlying reader remains open.
public boolean closeIndex() { try { searcher.close(); reader.close(); return true; } catch (IOException e) { e.printStackTrace(); } return false; }
public void close() { try { if (indexSearcher != null) { indexSearcher.close(); } if (indexReader != null) { indexReader.close(); } } catch (IOException e) { LOGGER.warn("Exception closing Pensieve index.", e); //$NON-NLS-1$ } } }
@Deactivate public void deactivate() { try { if(reader!=null) reader.close(); if(searcher!=null) searcher.close(); } catch (IOException e) { logger.error("Failed to close the index",e); } }
public void rollback() throws IOException { if (indexSearcher != null) { indexSearcher.close(); } if (indexReader != null) { indexReader.close(); } indexWriter.rollback(); indexWriter = null; }
public void postQuery() throws IndexerException{ if (searcher != null){ try { searcher.close(); } catch (IOException e) { log.error( this, e); throw new IndexerException(e); } searcher = null; } }
private void resetSearcher() { if( indexSearcher != null ) { try { indexSearcher.close(); } catch (IOException e) { config.log(e); } finally { indexSearcher = null; } } }
private synchronized void closeIndexSearcher() { if (nonNull(this.indexSearcher)) { try { this.indexSearcher.close(); } catch (IOException e) { log.catching(e); } } this.indexSearcher = null; }
public void commit() throws IOException { if (indexSearcher != null) { indexSearcher.close(); } if (indexReader != null) { indexReader.close(); } if (optimize) { indexWriter.optimize(); } indexWriter.close(); indexWriter = null; }
protected void closeIndexSearcher() { if (indexSearcher == null) { return; } try { indexSearcher.close(); } catch (IOException e) { throw new SearchEngineException(e); } }
protected IndexSearcher createIndexSearcher() throws CorruptIndexException, IOException { if (indexSearcher != null) indexSearcher.close(); return new IndexSearcher(openIndexReader()); }
public Object search(LuceneCallback lc) throws IOException { synchronized (directory) { IndexReader ir = IndexReader.open(directory); IndexSearcher is = new IndexSearcher(ir); try { return lc.doCallback(is); } finally { is.close(); ir.close(); } } } }
private void releaseSearcher(IndexSearcher searcher) throws ApsSystemException { try { if (searcher != null) { searcher.getIndexReader().close(); searcher.close(); } } catch (IOException e) { throw new ApsSystemException("Errore in chiusura searcher", e); } }
public void close() { try { searcher.close(); decReaderRef(); } catch (final IOException e) { throw new RuntimeIOException(e); } }