/** Moves all in-memory segments to the {@link Directory}, but does not commit * (fsync) them (call {@link #commit} for that). */ public final void flush() throws IOException { flush(true, true); }
ensureOpen(); flush(true, true);
infoStream.message("IW", "now flush at forceMerge"); flush(true, true); synchronized(this) { resetMergeExceptions();
flush(true, true); waitForMerges(); commitInternal(config.getMergePolicy());
flush(false, true);
infoStream.message("IW", "flush at addIndexes(CodecReader...)"); flush(false, true);
writer.flush();
/** Moves all in-memory segments to the {@link Directory}, but does not commit * (fsync) them (call {@link #commit} for that). */ public final void flush() throws IOException { flush(true, true); }
/** Moves all in-memory segments to the {@link Directory}, but does not commit * (fsync) them (call {@link #commit} for that). */ public final void flush() throws IOException { flush(true, true); }
/** Moves all in-memory segments to the {@link Directory}, but does not commit * (fsync) them (call {@link #commit} for that). */ public final void flush() throws IOException { flush(true, true); }
public void flush(boolean isClose) throws IOException { writer.flush(); writer.commit(); if (isClose) { writer.close(); } } }
@Override public void commit() throws IOException { indexWriter.flush(); indexWriter.commit(); refresh(); }
private final void prepareCommit(boolean internal) throws CorruptIndexException, IOException { if (hitOOM) throw new IllegalStateException("this writer hit an OutOfMemoryError; cannot commit"); if (autoCommit && !internal) throw new IllegalStateException("this method can only be used when autoCommit is false"); if (!autoCommit && pendingCommit != null) throw new IllegalStateException("prepareCommit was already called with no corresponding call to commit"); message("prepareCommit: flush"); flush(true, true, true); startCommit(0); }
private final void prepareCommit(boolean internal) throws CorruptIndexException, IOException { if (hitOOM) throw new IllegalStateException("this writer hit an OutOfMemoryError; cannot commit"); if (autoCommit && !internal) throw new IllegalStateException("this method can only be used when autoCommit is false"); if (!autoCommit && pendingCommit != null) throw new IllegalStateException("prepareCommit was already called with no corresponding call to commit"); message("prepareCommit: flush"); flush(true, true, true); startCommit(0); }
/** * Deletes the document(s) matching the provided query. * @param query the query to identify the documents to be deleted * @throws CorruptIndexException if the index is corrupt * @throws IOException if there is a low-level IO error */ public void deleteDocuments(Query query) throws CorruptIndexException, IOException { ensureOpen(); boolean doFlush = docWriter.bufferDeleteQuery(query); if (doFlush) flush(true, false, false); }
@Override public void flush() throws IOException { try (val writer = provideWriter()) { writer.use().flush(); } }
private void flushIndex(IndexWriter indexWriter) { try { indexWriter.flush(); } catch (IOException e) { throw log.unableToFlushIndex( getEventContext(), e ); } }
/** * Deletes the document(s) matching the provided query. * @param query the query to identify the documents to be deleted * @throws CorruptIndexException if the index is corrupt * @throws IOException if there is a low-level IO error */ public void deleteDocuments(Query query) throws CorruptIndexException, IOException { ensureOpen(); boolean doFlush = docWriter.bufferDeleteQuery(query); if (doFlush) flush(true, false, false); }
/** * Deletes the document(s) matching any of the provided queries. * All deletes are flushed at the same time. * @param queries array of queries to identify the documents * to be deleted * @throws CorruptIndexException if the index is corrupt * @throws IOException if there is a low-level IO error */ public void deleteDocuments(Query[] queries) throws CorruptIndexException, IOException { ensureOpen(); boolean doFlush = docWriter.bufferDeleteQueries(queries); if (doFlush) flush(true, false, false); }