예제 #1
0
 private void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (_indexModifier != null)
         {
             _indexModifier.Dispose();
         }
         _indexModifier = null;
     }
 }
예제 #2
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        /// <exception cref="ArgumentNullException">if newsHandler or configuration are null</exception>
        /// <exception cref="IOException">On indexPath directory creation failures</exception>
        /// <exception cref="SecurityException">On indexPath directory creation failures</exception>
        public LuceneSearch(INewsComponentsConfiguration configuration)
        {
            if (configuration.SearchIndexBehavior != SearchIndexBehavior.NoIndexing)
            {
                this._settings = new LuceneSettings(configuration);

                startIndexAll = (this._settings.IsRAMBasedSearch ||
                                 IsIndexCorrupted(this._settings.GetIndexDirectory()) ||
                                 !IndexReader.IndexExists(this._settings.GetIndexDirectory()));

                this._indexModifier = new LuceneIndexModifier(this._settings);
            }
        }
예제 #3
0
        public LuceneIndexer(LuceneIndexModifier indexModifier, IList <FeedSource> newsHandlers)
        {
            this.indexModifier = indexModifier;
            if (this.indexModifier == null)
            {
                throw new ArgumentNullException("indexModifier");
            }

            this.newsHandlers = newsHandlers;
            if (this.newsHandlers == null || this.newsHandlers.Count == 0)
            {
                throw new ArgumentException("newsHandlers");
            }
        }