org.apache.solr.update

## Class SolrIndexWriter

- java.lang.Object
- - org.apache.lucene.index.IndexWriter
  - - org.apache.solr.update.SolrIndexWriter

- All Implemented Interfaces:
    Closeable, AutoCloseable, TwoPhaseCommit, Accountable

      public class SolrIndexWriter
      extends 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

      `IndexWriter.IndexReaderWarmer`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `COMMIT_TIME_MSEC_KEY` Stored into each Lucene commit to record the System.currentTimeMillis() when commit was called.
    `static AtomicLong` | `numCloses`
    `static AtomicLong` | `numOpens`

    - ### Fields inherited from class org.apache.lucene.index.IndexWriter

      `MAX_DOCS, MAX_POSITION, MAX_TERM_LENGTH, SOURCE, SOURCE_ADDINDEXES_READERS, SOURCE_FLUSH, SOURCE_MERGE, WRITE_LOCK_NAME`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SolrIndexWriter(String name, Directory d, IndexWriterConfig conf)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `static SolrIndexWriter` | `create(SolrCore core, String name, String path, DirectoryFactory directoryFactory, boolean create, IndexSchema schema, SolrIndexConfig config, IndexDeletionPolicy delPolicy, Codec codec)`
    `protected void` | `finalize()`
    `void` | `rollback()`
    `static void` | `setCommitData(IndexWriter iw)`

    - ### Methods inherited from class org.apache.lucene.index.IndexWriter

      `addDocument, addDocuments, addIndexes, addIndexes, advanceSegmentInfosVersion, commit, decRefDeleter, deleteAll, deleteDocuments, deleteDocuments, deleteUnusedFiles, doAfterFlush, doBeforeFlush, ensureOpen, ensureOpen, flush, forceMerge, forceMerge, forceMergeDeletes, forceMergeDeletes, getAnalyzer, getCommitData, getConfig, getDirectory, getLiveCommitData, getMaxCompletedSequenceNumber, getMergingSegments, getNextMerge, getTragicException, hasDeletions, hasPendingMerges, hasUncommittedChanges, incRefDeleter, isLocked, isOpen, maxDoc, maybeMerge, merge, numDeletedDocs, numDocs, numRamDocs, prepareCommit, ramBytesUsed, setCommitData, setLiveCommitData, setLiveCommitData, tryDeleteDocument, updateBinaryDocValue, updateDocument, updateDocuments, updateDocValues, updateNumericDocValue`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.lucene.util.Accountable

      `getChildResources`

- - ### Field Detail

    - #### numOpens

          public static final AtomicLong numOpens

    - #### numCloses

          public static final AtomicLong numCloses

    - #### COMMIT_TIME_MSEC_KEY

          public 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

  - ### Constructor Detail

    - #### SolrIndexWriter

          public SolrIndexWriter(String name,
                                 Directory d,
                                 IndexWriterConfig conf)
                          throws IOException

      Throws:
        `IOException`

  - ### Method Detail

    - #### create

          public static SolrIndexWriter create(SolrCore core,
                                               String name,
                                               String path,
                                               DirectoryFactory directoryFactory,
                                               boolean create,
                                               IndexSchema schema,
                                               SolrIndexConfig config,
                                               IndexDeletionPolicy delPolicy,
                                               Codec codec)
                                        throws IOException

      Throws:
        `IOException`

    - #### setCommitData

          public static void setCommitData(IndexWriter iw)

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      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`

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.