public virtual void BuildFieldConfig(FieldConfig fieldConfig) { if (this.config.TryGetValue(ConfigurationKeys.FIELD_BOOST_MAP, out IDictionary <string, float> fieldBoostMap) && fieldBoostMap.TryGetValue(fieldConfig.Field, out float boost)) { fieldConfig.Set(ConfigurationKeys.BOOST, boost); } }
public virtual void BuildFieldConfig(FieldConfig fieldConfig) { // LUCENENET: Simplified logic using TryGetValue if ((this.config.TryGetValue(ConfigurationKeys.FIELD_DATE_RESOLUTION_MAP, out IDictionary <string, DateResolution> dateResMap) && dateResMap.TryGetValue(fieldConfig.Field, out DateResolution dateRes)) || this.config.TryGetValue(ConfigurationKeys.DATE_RESOLUTION, out dateRes)) { fieldConfig.Set(ConfigurationKeys.DATE_RESOLUTION, dateRes); } }
public virtual void BuildFieldConfig(FieldConfig fieldConfig) { IDictionary <string, float?> fieldBoostMap = this.config.Get(ConfigurationKeys.FIELD_BOOST_MAP); if (fieldBoostMap != null) { if (fieldBoostMap.TryGetValue(fieldConfig.Field, out float?boost) && boost != null) { fieldConfig.Set(ConfigurationKeys.BOOST, boost); } } }
public virtual void BuildFieldConfig(FieldConfig fieldConfig) { IDictionary <string, NumericConfig> numericConfigMap = config .Get(ConfigurationKeys.NUMERIC_CONFIG_MAP); if (numericConfigMap != null) { if (numericConfigMap.TryGetValue(fieldConfig.Field, out NumericConfig numericConfig) && numericConfig != null) { fieldConfig.Set(ConfigurationKeys.NUMERIC_CONFIG, numericConfig); } } }
public virtual void BuildFieldConfig(FieldConfig fieldConfig) { IDictionary<string, NumericConfig> numericConfigMap = config .Get(ConfigurationKeys.NUMERIC_CONFIG_MAP); if (numericConfigMap != null) { NumericConfig numericConfig; if (numericConfigMap.TryGetValue(fieldConfig.Field, out numericConfig) && numericConfig != null) { fieldConfig.Set(ConfigurationKeys.NUMERIC_CONFIG, numericConfig); } } }
public virtual void BuildFieldConfig(FieldConfig fieldConfig) { DateTools.Resolution?dateRes = null; IDictionary <string, DateTools.Resolution?> dateResMap = this.config.Get(ConfigurationKeys.FIELD_DATE_RESOLUTION_MAP); if (dateResMap != null) { dateResMap.TryGetValue(fieldConfig.Field, out dateRes); } if (dateRes == null) { dateRes = this.config.Get(ConfigurationKeys.DATE_RESOLUTION); } if (dateRes != null) { fieldConfig.Set(ConfigurationKeys.DATE_RESOLUTION, dateRes.Value); } }
public virtual void BuildFieldConfig(FieldConfig fieldConfig) { DateTools.Resolution? dateRes = null; IDictionary<string, DateTools.Resolution?> dateResMap = this.config.Get(ConfigurationKeys.FIELD_DATE_RESOLUTION_MAP); if (dateResMap != null) { dateResMap.TryGetValue(fieldConfig.Field, out dateRes); } if (dateRes == null) { dateRes = this.config.Get(ConfigurationKeys.DATE_RESOLUTION); } if (dateRes != null) { fieldConfig.Set(ConfigurationKeys.DATE_RESOLUTION, dateRes.Value); } }