public ESIndexDefinition(XmlHelper xml, XmlNode node, OnLoadConfig onLoadConfig) : this(node, onLoadConfig) { DocTypes = loadDocTypesFromNode(node); if (ConfigFile != null) { ConfigFile = xml.CombinePath(ConfigFile); } }
public ESIndexDefinitions(XmlHelper xml, XmlNode node, OnLoadConfig onLoadConfig = null) { XmlNodeList nodes = node.SelectMandatoryNodes("index"); list = new List <ESIndexDefinition>(nodes.Count); dict = new StringDict <ESIndexDefinition>(nodes.Count); foreach (XmlNode x in nodes) { ESIndexDefinition def = new ESIndexDefinition(xml, x, onLoadConfig); list.Add(def); dict.Add(def.Name, def); } }
private ESIndexDefinition(XmlNode node, OnLoadConfig onLoadConfig) { this.onLoadConfig = onLoadConfig == null ? _defOnLoadConfig : onLoadConfig; Active = node.ReadBool("@active", true); ReadOnly = node.ReadBool("@readonly", false); Name = node.ReadStr("@name"); IndexName = node.ReadStr("@indexname", Name); AliasName = IndexName; ExtraAlias = node.ReadStr("@extra_alias", null); NumShardsOnCreate = node.ReadInt("@shards", -1); NumReplicasAfterIndexed = node.ReadInt("@replicas", -1); OptimizeToSegments = node.ReadInt("@optimize_segments", 5); OptimizeWait = node.ReadInt("@optimize_wait", 300000); //Default: 5 minutes AutoTimestampFieldName = node.ReadStr("@refreshinterval", null); RefreshIntervalDuringImport = node.ReadStr("@refreshinterval", null); ConfigFile = node.ReadStrRaw("@config", _XmlRawMode.ExceptNullValue | _XmlRawMode.EmptyToNull); IndexDateTimeFormat = node.ReadStrRaw("@indexname_dateformat", _XmlRawMode.DefaultOnNull | _XmlRawMode.EmptyToNull, ESIndexCmd.DEFAULT_DATETIMEFORMAT); Generations = node.ReadInt("@generations", IndexDateTimeFormat == null ? 0 : 2); if (Generations != 0 && IndexDateTimeFormat == null) { throw new BMNodeException(node, "Cannot have generations without indexname_dateformat."); } }