Beispiel #1
0
        /// <summary> Open an index with write access.
        ///
        /// </summary>
        /// <param name="file">the index directory
        /// </param>
        /// <param name="analyzer">the analyzer to use for adding new documents
        /// </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>
        /// <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 there is a low-level IO error </throws>
        public IndexModifier(System.IO.FileInfo file, Analyzer analyzer, bool create)
        {
            InitBlock();
            Directory dir = FSDirectory.GetDirectory(file);

            this.closeDir = true;
            Init(dir, analyzer, create);
        }
Beispiel #2
0
        /// <summary> Open an index with write access.
        ///
        /// </summary>
        /// <param name="dirName">the index directory
        /// </param>
        /// <param name="analyzer">the analyzer to use for adding new documents
        /// </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>
        /// <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 there is a low-level IO error </throws>
        public IndexModifier(System.String dirName, Analyzer analyzer, bool create)
        {
            InitBlock();
            Directory dir = FSDirectory.GetDirectory(dirName);

            this.closeDir = true;
            Init(dir, analyzer, create);
        }