code: func (i *Index) openFields() error {
  	f, err := os.Open(i.path)
  	if err != nil {
  		return errors.Wrap(err, "opening directory")
  	}
  	defer f.Close()
  
  	fis, err := f.Readdir(0)
  	if err != nil {
  		return errors.Wrap(err, "reading directory")
  	}
  
  	for _, fi := range fis {
  		if !fi.IsDir() {
  			continue
  		}
  
  		i.logger.Debugf("open field: %s", fi.Name())
  		fld, err := i.newField(i.fieldPath(filepath.Base(fi.Name())), filepath.Base(fi.Name()))
  		if err != nil {
  			return errors.Wrapf(ErrName, "'%s'", fi.Name())
  		}
  		if err := fld.Open(); err != nil {
  			return fmt.Errorf("open field: name=%s, err=%s", fld.Name(), err)
  		}
  		i.logger.Debugf("add field to index.fields: %s", fi.Name())
  		i.fields[fld.Name()] = fld
  	}
  	return nil
  }
docs: // openFields opens and initializes the fields inside the index.