Package org.apache.solr.update
Class SolrIndexWriter
- java.lang.Object
- 
- org.apache.lucene.index.IndexWriter
- 
- org.apache.solr.update.SolrIndexWriter
 
 
- 
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- org.apache.lucene.index.MergePolicy.MergeContext,- org.apache.lucene.index.TwoPhaseCommit,- org.apache.lucene.util.Accountable
 
 public class SolrIndexWriter extends org.apache.lucene.index.IndexWriterAn IndexWriter that is configured via Solr config mechanisms.- Since:
- solr 0.9
 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringCOMMIT_COMMAND_VERSIONstatic StringCOMMIT_TIME_MSEC_KEYStored into each Lucene commit to record the System.currentTimeMillis() when commit was called.static AtomicLongnumClosesstatic AtomicLongnumOpens
 - 
Constructor SummaryConstructors Constructor Description SolrIndexWriter(String name, org.apache.lucene.store.Directory d, org.apache.lucene.index.IndexWriterConfig conf)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()static SolrIndexWritercreate(SolrCore core, String name, String path, DirectoryFactory directoryFactory, boolean create, IndexSchema schema, SolrIndexConfig config, org.apache.lucene.index.IndexDeletionPolicy delPolicy, org.apache.lucene.codecs.Codec codec)protected voiddoAfterFlush()Map<String,Object>getRunningMerges()protected voidmerge(org.apache.lucene.index.MergePolicy.OneMerge merge)voidrollback()static voidsetCommitData(org.apache.lucene.index.IndexWriter iw, long commitCommandVersion, Map<String,String> commitData)- 
Methods inherited from class org.apache.lucene.index.IndexWriteraddDocument, addDocuments, addIndexes, addIndexes, addIndexesReaderMerge, advanceSegmentInfosVersion, commit, decRefDeleter, deleteAll, deleteDocuments, deleteDocuments, deleteUnusedFiles, doBeforeFlush, ensureOpen, ensureOpen, flush, flushNextBuffer, forceMerge, forceMerge, forceMergeDeletes, forceMergeDeletes, getAnalyzer, getConfig, getDirectory, getDocStats, getFieldNames, getFlushingBytes, getInfoStream, getLiveCommitData, getMaxCompletedSequenceNumber, getMergingSegments, getPendingNumDocs, getTragicException, hasDeletions, hasPendingMerges, hasUncommittedChanges, incRefDeleter, isEnableTestPoints, isOpen, maybeMerge, mergeSuccess, numDeletedDocs, numDeletesToMerge, numRamDocs, onTragicEvent, prepareCommit, ramBytesUsed, setLiveCommitData, setLiveCommitData, softUpdateDocument, softUpdateDocuments, tryDeleteDocument, tryUpdateDocValue, updateBinaryDocValue, updateDocument, updateDocuments, updateDocuments, updateDocValues, updateNumericDocValue
 
- 
 
- 
- 
- 
Field Detail- 
numOpenspublic static final AtomicLong numOpens 
 - 
numClosespublic static final AtomicLong numCloses 
 - 
COMMIT_TIME_MSEC_KEYpublic static final String COMMIT_TIME_MSEC_KEY Stored into each Lucene commit to record the System.currentTimeMillis() when commit was called.- See Also:
- Constant Field Values
 
 - 
COMMIT_COMMAND_VERSIONpublic static final String COMMIT_COMMAND_VERSION - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
SolrIndexWriterpublic SolrIndexWriter(String name, org.apache.lucene.store.Directory d, org.apache.lucene.index.IndexWriterConfig conf) throws IOException - Throws:
- IOException
 
 
- 
 - 
Method Detail- 
createpublic static SolrIndexWriter create(SolrCore core, String name, String path, DirectoryFactory directoryFactory, boolean create, IndexSchema schema, SolrIndexConfig config, org.apache.lucene.index.IndexDeletionPolicy delPolicy, org.apache.lucene.codecs.Codec codec) throws IOException - Throws:
- IOException
 
 - 
setCommitDatapublic static void setCommitData(org.apache.lucene.index.IndexWriter iw, long commitCommandVersion, Map<String,String> commitData)
 - 
mergeprotected void merge(org.apache.lucene.index.MergePolicy.OneMerge merge) throws IOException- Overrides:
- mergein class- org.apache.lucene.index.IndexWriter
- Throws:
- IOException
 
 - 
doAfterFlushprotected void doAfterFlush() throws IOException- Overrides:
- doAfterFlushin class- org.apache.lucene.index.IndexWriter
- Throws:
- IOException
 
 - 
closepublic void close() throws IOException- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Overrides:
- closein class- org.apache.lucene.index.IndexWriter
- Throws:
- IOException
 
 - 
rollbackpublic void rollback() throws IOException- Specified by:
- rollbackin interface- org.apache.lucene.index.TwoPhaseCommit
- Overrides:
- rollbackin class- org.apache.lucene.index.IndexWriter
- Throws:
- IOException
 
 
- 
 
-