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.IndexWriter
An IndexWriter that is configured via Solr config mechanisms.
- Since:
- solr 0.9
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.index.IndexWriter
org.apache.lucene.index.IndexWriter.DocStats, org.apache.lucene.index.IndexWriter.IndexReaderWarmer -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringStored into each Lucene commit to record the System.currentTimeMillis() when commit was called.static final io.opentelemetry.api.common.AttributeKey<String> static final io.opentelemetry.api.common.AttributeKey<String> static final io.opentelemetry.api.common.AttributeKey<String> static final AtomicLongstatic final AtomicLongstatic final io.opentelemetry.api.common.AttributeKey<String> Fields inherited from class org.apache.lucene.index.IndexWriter
MAX_DOCS, MAX_POSITION, MAX_STORED_STRING_LENGTH, MAX_TERM_LENGTH, SOURCE, SOURCE_ADDINDEXES_READERS, SOURCE_FLUSH, SOURCE_MERGE, WRITE_LOCK_NAMEFields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Constructor Summary
ConstructorsConstructorDescriptionSolrIndexWriter(String name, org.apache.lucene.store.Directory d, org.apache.lucene.index.IndexWriterConfig conf) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()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 voidprotected voidmerge(org.apache.lucene.index.MergePolicy.OneMerge merge) voidrollback()static voidsetCommitData(org.apache.lucene.index.IndexWriter iw, long commitCommandVersion, Map<String, String> commitData) voidsetMajorMergeDocs(long majorMergeDocs) Methods inherited from class org.apache.lucene.index.IndexWriter
addDocument, addDocuments, addIndexes, addIndexes, addIndexesReaderMerge, advanceSegmentInfosCounter, 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, getSegmentInfosCounter, 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, updateNumericDocValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
Field Details
-
numOpens
-
numCloses
-
COMMIT_TIME_MSEC_KEY
Stored into each Lucene commit to record the System.currentTimeMillis() when commit was called.- See Also:
-
COMMIT_COMMAND_VERSION
- See Also:
-
MERGE_TYPE_ATTR
-
MERGE_STATE_ATTR
-
MERGE_OP_ATTR
-
RESULT_ATTR
-
-
Constructor Details
-
SolrIndexWriter
public SolrIndexWriter(String name, org.apache.lucene.store.Directory d, org.apache.lucene.index.IndexWriterConfig conf) throws IOException - Throws:
IOException
-
-
Method Details
-
create
public 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
-
setCommitData
-
setMajorMergeDocs
public void setMajorMergeDocs(long majorMergeDocs) -
merge
- Overrides:
mergein classorg.apache.lucene.index.IndexWriter- Throws:
IOException
-
getRunningMerges
-
doAfterFlush
- Overrides:
doAfterFlushin classorg.apache.lucene.index.IndexWriter- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classorg.apache.lucene.index.IndexWriter- Throws:
IOException
-
rollback
- Specified by:
rollbackin interfaceorg.apache.lucene.index.TwoPhaseCommit- Overrides:
rollbackin classorg.apache.lucene.index.IndexWriter- Throws:
IOException
-