/// <summary> Expert: constructs an IndexWriter with a custom {@link /// IndexDeletionPolicy} and {@link IndexingChain}, /// for the index in <code>d</code>. /// Text will be analyzed with <code>a</code>. If /// <code>create</code> is true, then a new, empty index /// will be created in <code>d</code>, replacing the index /// already there, if any. /// /// <p/><b>NOTE</b>: autoCommit (see <a /// href="#autoCommit">above</a>) is set to false with this /// constructor. /// /// </summary> /// <param name="d">the index directory /// </param> /// <param name="a">the analyzer to use /// </param> /// <param name="create"><code>true</code> to create the index or overwrite /// the existing one; <code>false</code> to append to the existing /// index /// </param> /// <param name="deletionPolicy">see <a href="#deletionPolicy">above</a> /// </param> /// <param name="mfl">whether or not to limit field lengths, value is in number of terms/tokens. See {@link Lucene.Net.Index.IndexWriter.MaxFieldLength}. /// </param> /// <param name="indexingChain">the {@link DocConsumer} chain to be used to /// process documents /// </param> /// <param name="commit">which commit to open /// </param> /// <throws> CorruptIndexException if the index is corrupt </throws> /// <throws> LockObtainFailedException if another writer </throws> /// <summary> has this index open (<code>write.lock</code> could not /// be obtained) /// </summary> /// <throws> IOException if the directory cannot be read/written to, or </throws> /// <summary> if it does not exist and <code>create</code> is /// <code>false</code> or if there is any other low-level /// IO error /// </summary> internal IndexWriter(Directory d, Analyzer a, bool create, IndexDeletionPolicy deletionPolicy, MaxFieldLength mfl, IndexingChain indexingChain, IndexCommit commit) { InitBlock(); Init(d, a, create, false, deletionPolicy, false, mfl.GetLimit(), indexingChain, commit); }
/// <summary> Expert: constructs an IndexWriter on specific commit /// point, with a custom {@link IndexDeletionPolicy}, for /// the index in <code>d</code>. Text will be analyzed /// with <code>a</code>. /// /// <p/> This is only meaningful if you've used a {@link /// IndexDeletionPolicy} in that past that keeps more than /// just the last commit. /// /// <p/>This operation is similar to {@link #Rollback()}, /// except that method can only rollback what's been done /// with the current instance of IndexWriter since its last /// commit, whereas this method can rollback to an /// arbitrary commit point from the past, assuming the /// {@link IndexDeletionPolicy} has preserved past /// commits. /// /// <p/><b>NOTE</b>: autoCommit (see <a /// href="#autoCommit">above</a>) is set to false with this /// constructor. /// /// </summary> /// <param name="d">the index directory /// </param> /// <param name="a">the analyzer to use /// </param> /// <param name="deletionPolicy">see <a href="#deletionPolicy">above</a> /// </param> /// <param name="mfl">whether or not to limit field lengths, value is in number of terms/tokens. See {@link Lucene.Net.Index.IndexWriter.MaxFieldLength}. /// </param> /// <param name="commit">which commit to open /// </param> /// <throws> CorruptIndexException if the index is corrupt </throws> /// <throws> LockObtainFailedException if another writer </throws> /// <summary> has this index open (<code>write.lock</code> could not /// be obtained) /// </summary> /// <throws> IOException if the directory cannot be read/written to, or </throws> /// <summary> if it does not exist and <code>create</code> is /// <code>false</code> or if there is any other low-level /// IO error /// </summary> public IndexWriter(Directory d, Analyzer a, IndexDeletionPolicy deletionPolicy, MaxFieldLength mfl, IndexCommit commit) { InitBlock(); Init(d, a, false, false, deletionPolicy, false, mfl.GetLimit(), null, commit); }
/// <summary> Expert: constructs an IndexWriter with a custom {@link /// IndexDeletionPolicy}, for the index in <code>d</code>. /// Text will be analyzed with <code>a</code>. If /// <code>create</code> is true, then a new, empty index /// will be created in <code>d</code>, replacing the index /// already there, if any. /// /// <p/><b>NOTE</b>: autoCommit (see <a /// href="#autoCommit">above</a>) is set to false with this /// constructor. /// /// </summary> /// <param name="d">the index directory /// </param> /// <param name="a">the analyzer to use /// </param> /// <param name="create"><code>true</code> to create the index or overwrite /// the existing one; <code>false</code> to append to the existing /// index /// </param> /// <param name="deletionPolicy">see <a href="#deletionPolicy">above</a> /// </param> /// <param name="mfl">{@link Lucene.Net.Index.IndexWriter.MaxFieldLength}, whether or not to limit field lengths. Value is in number of terms/tokens /// </param> /// <throws> CorruptIndexException if the index is corrupt </throws> /// <throws> LockObtainFailedException if another writer </throws> /// <summary> has this index open (<code>write.lock</code> could not /// be obtained) /// </summary> /// <throws> IOException if the directory cannot be read/written to, or </throws> /// <summary> if it does not exist and <code>create</code> is /// <code>false</code> or if there is any other low-level /// IO error /// </summary> public IndexWriter(Directory d, Analyzer a, bool create, IndexDeletionPolicy deletionPolicy, MaxFieldLength mfl) { InitBlock(); Init(d, a, create, false, deletionPolicy, false, mfl.GetLimit(), null, null); }
/// <summary> Constructs an IndexWriter for the index in /// <code>d</code>, first creating it if it does not /// already exist. Text will be analyzed with /// <code>a</code>. /// /// <p/><b>NOTE</b>: autoCommit (see <a /// href="#autoCommit">above</a>) is set to false with this /// constructor. /// /// </summary> /// <param name="d">the index directory /// </param> /// <param name="a">the analyzer to use /// </param> /// <param name="mfl">Maximum field length in number of terms/tokens: LIMITED, UNLIMITED, or user-specified /// via the MaxFieldLength constructor. /// </param> /// <throws> CorruptIndexException if the index is corrupt </throws> /// <throws> LockObtainFailedException if another writer </throws> /// <summary> has this index open (<code>write.lock</code> could not /// be obtained) /// </summary> /// <throws> IOException if the directory cannot be </throws> /// <summary> read/written to or if there is any other low-level /// IO error /// </summary> public IndexWriter(Directory d, Analyzer a, MaxFieldLength mfl) { InitBlock(); Init(d, a, false, null, false, mfl.GetLimit(), null, null); }
public IndexWriter(System.IO.FileInfo path, Analyzer a, MaxFieldLength mfl) { InitBlock(); Init(FSDirectory.GetDirectory(path), a, true, null, false, mfl.GetLimit(), null, null); }
public IndexWriter(System.String path, Analyzer a, bool create, MaxFieldLength mfl) { InitBlock(); Init(FSDirectory.GetDirectory(path), a, create, true, null, false, mfl.GetLimit(), null, null); }
/// <summary> /// Constructs an IndexWriter for the index in <code>path</code>. /// Text will be analyzed with <code>a</code>. /// <para> /// NOTE: autoCommit (see above) is set to false with this constructor. /// </para> /// <para>Throws CorruptIndexException if the index is corrupt</para> /// <para>Throws LockObtainFailedException if another writer has this index open (<code>write.lock</code> could not be obtained)</para> /// <para>Throws System.IO.IOException if the directory cannot be read/written to or if there is any other low-level IO error</para> /// </summary> /// <param name="path">the path to the index directory</param> /// <param name="a">the analyzer to use</param> /// <param name="mfl">Maximum field Length: LIMITED, UNLIMITED, or user-specified</param> public IndexWriter(string path, Analyzer a, MaxFieldLength mfl) { InitBlock(); Init(FSDirectory.GetDirectory(path), a, true, null, false, mfl.GetLimit()); }