org.apache.solr.update
Class SolrIndexWriter

java.lang.Object
  extended by org.apache.lucene.index.IndexWriter
      extended by org.apache.solr.update.SolrIndexWriter
All Implemented Interfaces:
Closeable, TwoPhaseCommit

public class SolrIndexWriter
extends IndexWriter

An IndexWriter that is configured via Solr config mechanisms.

Since:
solr 0.9
Version:
$Id: SolrIndexWriter.java 1305693 2012-03-27 00:43:47Z janhoy $

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.lucene.index.IndexWriter
IndexWriter.IndexReaderWarmer, IndexWriter.MaxFieldLength
 
Field Summary
static String LOCK_TYPE_NATIVE
           
static String LOCK_TYPE_NONE
           
static String LOCK_TYPE_SIMPLE
           
static String LOCK_TYPE_SINGLE
           
 
Fields inherited from class org.apache.lucene.index.IndexWriter
DEFAULT_MAX_BUFFERED_DELETE_TERMS, DEFAULT_MAX_BUFFERED_DOCS, DEFAULT_MAX_FIELD_LENGTH, DEFAULT_RAM_BUFFER_SIZE_MB, DEFAULT_TERM_INDEX_INTERVAL, DISABLE_AUTO_FLUSH, MAX_TERM_LENGTH, WRITE_LOCK_NAME, WRITE_LOCK_TIMEOUT
 
Constructor Summary
SolrIndexWriter(String name, String path, DirectoryFactory dirFactory, boolean create, IndexSchema schema, SolrIndexConfig config, IndexDeletionPolicy delPolicy)
           
 
Method Summary
 void close()
           
protected  void finalize()
           
static Directory getDirectory(String path, DirectoryFactory directoryFactory, SolrIndexConfig config)
           
 void rollback()
           
 
Methods inherited from class org.apache.lucene.index.IndexWriter
addDocument, addDocument, addDocuments, addDocuments, addIndexes, addIndexes, addIndexesNoOptimize, close, commit, commit, deleteAll, deleteDocuments, deleteDocuments, deleteDocuments, deleteDocuments, deleteUnusedFiles, doAfterFlush, doBeforeFlush, ensureOpen, ensureOpen, expungeDeletes, expungeDeletes, flush, flush, forceMerge, forceMerge, forceMergeDeletes, forceMergeDeletes, getAnalyzer, getConfig, getDefaultInfoStream, getDefaultWriteLockTimeout, getDirectory, getInfoStream, getMaxBufferedDeleteTerms, getMaxBufferedDocs, getMaxFieldLength, getMaxMergeDocs, getMergedSegmentWarmer, getMergeFactor, getMergePolicy, getMergeScheduler, getMergingSegments, getNextMerge, getPayloadProcessorProvider, getRAMBufferSizeMB, getReader, getReader, getReaderTermsIndexDivisor, getSimilarity, getTermIndexInterval, getUseCompoundFile, getWriteLockTimeout, hasDeletions, isLocked, maxDoc, maybeMerge, merge, message, numDeletedDocs, numDocs, numRamDocs, optimize, optimize, optimize, prepareCommit, prepareCommit, ramSizeInBytes, segString, segString, segString, setDefaultInfoStream, setDefaultWriteLockTimeout, setInfoStream, setMaxBufferedDeleteTerms, setMaxBufferedDocs, setMaxFieldLength, setMaxMergeDocs, setMergedSegmentWarmer, setMergeFactor, setMergePolicy, setMergeScheduler, setPayloadProcessorProvider, setRAMBufferSizeMB, setReaderTermsIndexDivisor, setSimilarity, setTermIndexInterval, setUseCompoundFile, setWriteLockTimeout, unlock, updateDocument, updateDocument, updateDocuments, updateDocuments, verbose, waitForMerges
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCK_TYPE_SIMPLE

public static final String LOCK_TYPE_SIMPLE
See Also:
Constant Field Values

LOCK_TYPE_NATIVE

public static final String LOCK_TYPE_NATIVE
See Also:
Constant Field Values

LOCK_TYPE_SINGLE

public static final String LOCK_TYPE_SINGLE
See Also:
Constant Field Values

LOCK_TYPE_NONE

public static final String LOCK_TYPE_NONE
See Also:
Constant Field Values
Constructor Detail

SolrIndexWriter

public SolrIndexWriter(String name,
                       String path,
                       DirectoryFactory dirFactory,
                       boolean create,
                       IndexSchema schema,
                       SolrIndexConfig config,
                       IndexDeletionPolicy delPolicy)
                throws IOException
Throws:
IOException
Method Detail

getDirectory

public static Directory getDirectory(String path,
                                     DirectoryFactory directoryFactory,
                                     SolrIndexConfig config)
                              throws IOException
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class IndexWriter
Throws:
IOException

rollback

public void rollback()
              throws IOException
Specified by:
rollback in interface TwoPhaseCommit
Overrides:
rollback in class IndexWriter
Throws:
IOException

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable