예제 #1
0
		/// <summary> Expert: constructs an IndexWriter on specific commit
		/// point, with a custom <see cref="IndexDeletionPolicy" />, for
		/// the index in <c>d</c>.  Text will be analyzed
		/// with <c>a</c>.
		/// 
		/// <p/> This is only meaningful if you've used a <see cref="IndexDeletionPolicy" />
		/// in that past that keeps more than
		/// just the last commit.
		/// 
		/// <p/>This operation is similar to <see cref="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
		/// <see cref="IndexDeletionPolicy" /> has preserved past
		/// commits.
		/// 
		/// </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 <see cref="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 (<c>write.lock</c> could not
		/// be obtained)
		/// </summary>
		/// <throws>  IOException if the directory cannot be read/written to, or </throws>
		/// <summary>  if it does not exist and <c>create</c> is
		/// <c>false</c> 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, deletionPolicy, mfl.Limit, null, commit);
		}
예제 #2
0
			static MaxFieldLength()
			{
				LIMITED = new MaxFieldLength("LIMITED", Lucene.Net.Index.IndexWriter.DEFAULT_MAX_FIELD_LENGTH);
			}
예제 #3
0
		/// <summary> Expert: constructs an IndexWriter with a custom <see cref="IndexDeletionPolicy" />
		///, for the index in <c>d</c>.
		/// Text will be analyzed with <c>a</c>.  If
		/// <c>create</c> is true, then a new, empty index
		/// will be created in <c>d</c>, replacing the index
		/// already there, if any.
		/// 
		/// </summary>
		/// <param name="d">the index directory
		/// </param>
		/// <param name="a">the analyzer to use
		/// </param>
		/// <param name="create"><c>true</c> to create the index or overwrite
		/// the existing one; <c>false</c> to append to the existing
		/// index
		/// </param>
		/// <param name="deletionPolicy">see <a href="#deletionPolicy">above</a>
		/// </param>
		/// <param name="mfl"><see cref="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 (<c>write.lock</c> could not
		/// be obtained)
		/// </summary>
		/// <throws>  IOException if the directory cannot be read/written to, or </throws>
		/// <summary>  if it does not exist and <c>create</c> is
		/// <c>false</c> 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, deletionPolicy, mfl.Limit, null, null);
		}
예제 #4
0
		/// <summary> Expert: constructs an IndexWriter with a custom <see cref="IndexDeletionPolicy" />
		/// and <see cref="DocumentsWriter.IndexingChain" />, 
		/// for the index in <c>d</c>.
		/// Text will be analyzed with <c>a</c>.  If
		/// <c>create</c> is true, then a new, empty index
		/// will be created in <c>d</c>, replacing the index
		/// already there, if any.
		/// 
		/// </summary>
		/// <param name="d">the index directory
		/// </param>
		/// <param name="a">the analyzer to use
		/// </param>
		/// <param name="create"><c>true</c> to create the index or overwrite
		/// the existing one; <c>false</c> 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 <see cref="Lucene.Net.Index.IndexWriter.MaxFieldLength" />.
		/// </param>
		/// <param name="indexingChain">the <see cref="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 (<c>write.lock</c> could not
		/// be obtained)
		/// </summary>
		/// <throws>  IOException if the directory cannot be read/written to, or </throws>
		/// <summary>  if it does not exist and <c>create</c> is
		/// <c>false</c> or if there is any other low-level
		/// IO error
		/// </summary>
		internal IndexWriter(Directory d, Analyzer a, bool create, IndexDeletionPolicy deletionPolicy, MaxFieldLength mfl, DocumentsWriter.IndexingChain indexingChain, IndexCommit commit)
		{
			InitBlock();
			Init(d, a, create, deletionPolicy, mfl.Limit, indexingChain, commit);
		}
예제 #5
0
		/// <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);
		}
예제 #6
0
		/// <summary> Constructs an IndexWriter for the index in
		/// <c>d</c>, first creating it if it does not
		/// already exist.  
		/// 
		/// </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 (<c>write.lock</c> 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, null, mfl.Limit, null, null);
		}
예제 #7
0
		/// <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);
		}
예제 #8
0
		/// <summary> Expert: constructs an IndexWriter with a custom {@link
		/// IndexDeletionPolicy}, 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="deletionPolicy">see <a href="#deletionPolicy">above</a>
		/// </param>
		/// <param name="mfl">whether or not to limit field lengths
		/// </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, IndexDeletionPolicy deletionPolicy, MaxFieldLength mfl)
		{
			InitBlock();
			Init(d, a, false, deletionPolicy, false, mfl.GetLimit(), null, null);
		}
예제 #9
0
        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);
		}
예제 #10
0
		public IndexWriter(System.IO.FileInfo path, Analyzer a, MaxFieldLength mfl)
		{
			InitBlock();
			Init(FSDirectory.GetDirectory(path), a, true, null, false, mfl.GetLimit(), null, null);
		}
예제 #11
0
 public MockIndexWriter(TestIndexWriterExceptions enclosingInstance, Directory dir, Analyzer a, bool create, MaxFieldLength mfl) : base(dir, a, create, mfl)
 {
     InitBlock(enclosingInstance);
 }
예제 #12
0
 /// <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());
 }
예제 #13
0
			public MockIndexWriter(TestIndexWriterExceptions enclosingInstance, Directory dir, Analyzer a, bool create, MaxFieldLength mfl):base(dir, a, create, mfl)
			{
				InitBlock(enclosingInstance);
			}
예제 #14
0
 public TimeTrackingIndexWriter(Directory d, Analyzer a, IndexDeletionPolicy deletionPolicy, MaxFieldLength mfl, IState state) : base(d, a, deletionPolicy, mfl, state)
 {
 }
예제 #15
0
 public FluentIndexWriter(Directory directory, Analyzer analyzer, MaxFieldLength maxFieldLength) : base(directory, analyzer, maxFieldLength)
 {
     _documentBuilder = new DocumentBuilder();
     _mapping         = LuceneMapper.GetMappingForType(typeof(T));
 }