code: func (db *DB) CreateIndex(name, pattern string,
  	less ...func(a, b string) bool) error {
  	return db.Update(func(tx *Tx) error {
  		return tx.CreateIndex(name, pattern, less...)
  	})
  }
docs: // CreateIndex builds a new index and populates it with items.
  // The items are ordered in an b-tree and can be retrieved using the
  // Ascend* and Descend* methods.
  // An error will occur if an index with the same name already exists.
  //
  // When a pattern is provided, the index will be populated with
  // keys that match the specified pattern. This is a very simple pattern
  // match where '*' matches on any number characters and '?' matches on
  // any one character.
  // The less function compares if string 'a' is less than string 'b'.
  // It allows for indexes to create custom ordering. It's possible
  // that the strings may be textual or binary. It's up to the provided
  // less function to handle the content format and comparison.
  // There are some default less function that can be used such as
  // IndexString, IndexBinary, etc.
  //
  // Deprecated: Use Transactions