code: func (v *view) open() error {
  
  	// Never keep a cache for field views.
  	if strings.HasPrefix(v.name, viewBSIGroupPrefix) {
  		v.cacheType = CacheTypeNone
  	}
  
  	if err := func() error {
  		// Ensure the view's path exists.
  		v.logger.Debugf("ensure view path exists: %s", v.path)
  		if err := os.MkdirAll(v.path, 0777); err != nil {
  			return errors.Wrap(err, "creating view directory")
  		} else if err := os.MkdirAll(filepath.Join(v.path, "fragments"), 0777); err != nil {
  			return errors.Wrap(err, "creating fragments directory")
  		}
  
  		v.logger.Debugf("open fragments for index/field/view: %s/%s/%s", v.index, v.field, v.name)
  		if err := v.openFragments(); err != nil {
  			return errors.Wrap(err, "opening fragments")
  		}
  
  		return nil
  	}(); err != nil {
  		v.close()
  		return err
  	}
  
  	v.logger.Debugf("successfully opened index/field/view: %s/%s/%s", v.index, v.field, v.name)
  	return nil
  }
docs: // open opens and initializes the view.