Пример #1
0
        public void TestValidUrl()
        {
            ElasticSearchContext context = new ElasticSearchContext("http://www.nu.nl");

            Assert.IsNotNull(context);
            Assert.IsTrue(!String.IsNullOrEmpty(context.Url));
        }
Пример #2
0
        public void TestContextSetup()
        {
            var context = new ElasticSearchContext("http://www.nu.nl");

            Assert.IsNotNull(context);
            Assert.IsNotNull(context.Url);
        }
Пример #3
0
 public void TestInvalidUrl()
 {
     Assert.ThrowsException <Exception>(() =>
     {
         try
         {
             var context = new ElasticSearchContext("uiyuiyuiy");
         } catch (Exception e)
         {
             throw new Exception("Something wrong URI", e);
         }
     });
 }
Пример #4
0
        private void Dispose(bool disposing)
        {
            if (!disposing)
            {
                return;
            }
            if (context != null)
            {
                context.Dispose();
                context = null;
            }

            if (ElasticSearchContext != null)
            {
                ElasticSearchContext = null;
            }
        }
Пример #5
0
 public ElasticSearchCommand(ElasticSearchContext esContext)
 {
     ContractUtility.Requires <ArgumentNullException>(esContext != null, "esContext instance cannot be null");
     _elasticsearchContext = esContext.ElasticsearchContext;
 }
Пример #6
0
 public ElasticSearchQuery(ElasticSearchContext esContext)
 {
     ContractUtility.Requires <ArgumentNullException>(esContext != null, "esContext instance cannot be null");
     _elasticsearchContext = esContext.ElasticsearchContext;
     _elasticsearchQuery   = esContext.Query <TEntity>();
 }
 public ElasticSearchRepository(ElasticSearchContext elasticSearchContext = null)
 {
     _elasticSearchContext = elasticSearchContext != null ? elasticSearchContext : new ElasticSearchContext();
 }
Пример #8
0
 public SearchRepository(ElasticSearchContext client)
 {
     _client = client._client;
 }