|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.lucene.index.IndexWriter
org.apache.lucene.gdata.search.index.GDataIndexWriter
public class GDataIndexWriter
Configurable decorator for a lucene IndexWriter
Field Summary |
---|
Fields inherited from class org.apache.lucene.index.IndexWriter |
---|
DEFAULT_MAX_BUFFERED_DELETE_TERMS, DEFAULT_MAX_BUFFERED_DOCS, DEFAULT_MAX_FIELD_LENGTH, DEFAULT_MAX_MERGE_DOCS, DEFAULT_MERGE_FACTOR, DEFAULT_TERM_INDEX_INTERVAL, WRITE_LOCK_NAME, WRITE_LOCK_TIMEOUT |
Constructor Summary | |
---|---|
protected |
GDataIndexWriter(Directory arg0,
boolean arg1,
IndexSchema arg2)
Creates and configures a new GdataIndexWriter |
Method Summary | |
---|---|
void |
close()
Flushes all changes to an index and closes all associated files. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected GDataIndexWriter(Directory arg0, boolean arg1, IndexSchema arg2) throws IOException
arg0
- -
the index directoryarg1
- -
create indexarg2
- -
the index schema configuration including all parameter to set
up the index writer
IOException
- -if the directory cannot be read/written to, or if it does
not exist, and create
is false
Method Detail |
---|
public void close() throws IOException
IndexWriter
If an Exception is hit during close, eg due to disk full or some other reason, then both the on-disk index and the internal state of the IndexWriter instance will be consistent. However, the close will not be complete even though part of it (flushing buffered documents) may have succeeded, so the write lock will still be held.
If you can correct the underlying cause (eg free up some disk space) then you can call close() again. Failing that, if you want to force the write lock to be released (dangerous, because you may then lose buffered docs in the IndexWriter instance) then you can do something like this:
try { writer.close(); } finally { if (IndexReader.isLocked(directory)) { IndexReader.unlock(directory); } }after which, you must be certain not to use the writer instance anymore.
close
in class IndexWriter
CorruptIndexException
- if the index is corrupt
IOException
- if there is a low-level IO errorIndexWriter.close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |