code: func DecodeConfig(in interface{}) (Config, error) {
  	if in == nil {
  		return Config{}, errors.New("no related config provided")
  	}
  
  	m, ok := in.(map[string]interface{})
  	if !ok {
  		return Config{}, fmt.Errorf("expected map[string]interface {} got %T", in)
  	}
  
  	if len(m) == 0 {
  		return Config{}, errors.New("empty related config provided")
  	}
  
  	var c Config
  
  	if err := mapstructure.WeakDecode(m, &c); err != nil {
  		return c, err
  	}
  
  	if c.Threshold < 0 || c.Threshold > 100 {
  		return Config{}, errors.New("related threshold must be between 0 and 100")
  	}
  
  	if c.ToLower {
  		for i := range c.Indices {
  			c.Indices[i].ToLower = true
  		}
  	}
  
  	return c, nil
  }
docs: // DecodeConfig decodes a slice of map into Config.