private void initialize(ES_Config config, ES_ClusterName clusterName) { if (config != null) { this.Config = config; } else { this.Config = new ES_Config() { BasePath = "http://localhost:9200", // TODO: Get this value from the Config Portal ClusterName = clusterName.ToString(), ClassName = ( (clusterName == ES_ClusterName.calls) ? "ES_CallService" : (clusterName == ES_ClusterName.messages) ? "ES_MessageService" : "ES_ScreenService" ), PutMappingsPath = "/" + clusterName.ToString() + "_{0}", PutDocumentPath = "/" + clusterName.ToString() + "_{0}/_doc/{1}", GetDocumentByIdPath = "/" + clusterName.ToString() + "_{0}/_doc/{1}", DeleteDocumentByIdPath = "/" + clusterName.ToString() + "_{0}/_doc/{1}", DeleteAllByTenantIdPath = "/" + clusterName.ToString() + "_{0}", GetDocumentsByIdsPath = "/" + clusterName.ToString() + "_{0}/_doc/_mget", GetDocumentsByQueryPath = "/" + clusterName.ToString() + "_{0}/_doc/_search", GetMappingsPath = "/" + clusterName.ToString() + "_{0}/_mapping/_doc" }; } }
public ES_CallService(ES_Config config) : base(config, Base_Classes.ES_ClusterName.calls) { //LogEntry.WriteNLogEntry( // string.Format("ES_CallService.Initialize()\n\nBasePath: {0}\nClusterName: {1}", this.Config.BasePath, this.Config.ClusterName), // NLog.LogLevel.Trace, // LogEvent.EventManagerElasticsearchGeneral //); initialize(); }
protected ES_DataService(ES_Config config, ES_ClusterName clusterName) { initialize(config, clusterName); }