Class that implements a cache for OpenSearch Request and Response.
Esempio n. 1
0
        public void RunBeforeTests()
        {
            XmlConfigurator.Configure(new FileInfo("../Log4Net.config"));

            AddinManager.Initialize();
            AddinManager.Registry.Update(null);

            ose = new OpenSearchEngine();
            ose.LoadPlugins();

            OpenSearchMemoryCache cache = new OpenSearchMemoryCache();

            ose.RegisterPreSearchFilter(cache.TryReplaceWithCacheRequest);
            ose.RegisterPostSearchFilter(cache.CacheResponse);
        }
        private void InitCache()
        {
            NameValueCollection cacheSettings = new NameValueCollection();
            cacheSettings.Add("SlidingExpiration", "600");

            searchCache = new OpenSearchMemoryCache("cache", cacheSettings);
            ose.RegisterPreSearchFilter(searchCache.TryReplaceWithCacheRequest);
            ose.RegisterPostSearchFilter(searchCache.CacheResponse);
        }
Esempio n. 3
0
        private void LoadStaticObject()
        {
            OpenSearchEngine = new OpenSearchEngine();
            OpenSearchEngine.LoadPlugins();

            NameValueCollection cacheSettings = new NameValueCollection();
            cacheSettings.Add("SlidingExpiration", "600");

            AppHost.searchCache = new OpenSearchMemoryCache("cache", cacheSettings);
            OpenSearchEngine.RegisterPreSearchFilter(AppHost.searchCache.TryReplaceWithCacheRequest);
            OpenSearchEngine.RegisterPostSearchFilter(AppHost.searchCache.CacheResponse);

            ElasticCasFactory.LoadPlugins(this);
        }