public ElasticSearchHelper()
    {
      var settings = new ConnectionSettings(WebConfigHelper.ElasticSearchUri, indexName);
      settings.ThrowOnElasticsearchServerExceptions();

      elasticClient = new ElasticClient(settings);
      searchDefinition = ElasticSearchHelper.GetSearchDefinition();
    }
コード例 #2
0
        public ConnectionSettings Get()
        {
            var pool = new SniffingConnectionPool(Url);

            var settings = new ConnectionSettings(pool);
            settings.ThrowOnElasticsearchServerExceptions();

            if (EnableTrace)
                settings.EnableTrace();

            return settings;
        }
コード例 #3
0
      public IndexPopulator(string siteId)
      {
        SiteID = siteId;

        this.IndexName = SiteID.ToLower() + "_trainingindex";

        var node = ElasticSearchUri;

        var settings = new ConnectionSettings(node, this.IndexName);
        settings.ThrowOnElasticsearchServerExceptions(true);

        this.SearchClient = new ElasticClient(settings);
      }
コード例 #4
0
 public ElasticClient GetElasticClient()
 {
     ConnectionSettings settings = new ConnectionSettings(connectionPool, ElasticMappingConstants.INDEX_NAME);
     settings.ThrowOnElasticsearchServerExceptions(true);
     return new ElasticClient(settings);
 }