public function commit($delete = true)
    {
        $diff = $this->getDiff();

        if ($delete) {
            foreach ($diff['unknown'] as $index) {
                $this->deleteIndex($index['name']);
            }
        }

        foreach ($diff['missing'] as $name => $index) {
            $this->ensureIndex($index['keys'], $index['options']);
        }

        return true;
    }