コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SearchServiceConfiguration" /> class.
        /// </summary>
        /// <param name="luceneVersion">The lucene version.</param>
        /// <param name="maxFieldLength">Maximum length of the field.</param>
        /// <param name="indexFolder">The index folder.</param>
        /// <param name="writeLockSemaphoreFileName">Name of the write lock semaphore file.</param>
        /// <param name="hitLimit">The hit limit.</param>
	    public SearchServiceConfiguration(
            Version luceneVersion,
            IndexWriter.MaxFieldLength maxFieldLength,
            string indexFolder,
            string writeLockSemaphoreFileName,
            int hitLimit)
	    {
            this.luceneVersion = luceneVersion.IsNull() ? Version.LUCENE_30 : luceneVersion;

            this.maxFieldLength = maxFieldLength.IsNull() ? IndexWriter.MaxFieldLength.UNLIMITED : maxFieldLength;

            this.indexFolder = indexFolder.IsNullOrEmpty() ? @"C:\SearchIndex\" : indexFolder;

            this.writeLockSemaphoreFileName = writeLockSemaphoreFileName.IsNullOrEmpty() ? Path.Combine(this.indexFolder, "write.lock") : writeLockSemaphoreFileName;

            this.hitLimit = hitLimit.Equals(EqualityComparer<int>.Default.Equals(hitLimit, default(int))) ? 1000 : hitLimit;

            this.fsDirectory = this.GetDirectory();
	    }