コード例 #1
0
        public void Dispose()
        {
            if (_disposed)
            {
                return;
            }

            Log.Debug("Object disposed");
            _indexWrapper.ReleaseSearcher(this);

            _indexSearcher = null;
            _indexWrapper  = null;
            _disposed      = true;
        }
コード例 #2
0
        internal LuceneIndexSearcherRef(IndexSearcher indexSearcher, LuceneIndexWrapper indexWrapper)
        {
            if (indexSearcher == null)
            {
                throw new ArgumentNullException(nameof(indexSearcher));
            }
            if (indexWrapper == null)
            {
                throw new ArgumentNullException(nameof(indexWrapper));
            }

            _indexSearcher = indexSearcher;
            _indexWrapper  = indexWrapper;

            Log.Debug("Object constructed");
        }
コード例 #3
0
        public void InitializeIndex(string indexId)
        {
            Log.InfoFormat("Initializing index id {0}", indexId);

            // Re-register configuration keys in case a client haven't called RegisterConfigurationKeys prior to this method
            RegisterConfigurationKeys(indexId);

            lock (IndexesLock)
            {
                if (Indexes.ContainsKey(indexId))
                {
                    return;
                }

                var luceneIndexWrapper = new LuceneIndexWrapper(indexId);
                Composer.InitializePlugs(luceneIndexWrapper);

                Indexes[indexId] = luceneIndexWrapper;
            }
        }
コード例 #4
0
 public static void RegisterConfigurationKeys(string indexId)
 {
     LuceneIndexWrapper.RegisterConfigurationKeys(indexId);
 }