Clear the contents (all the entries) of an index object.
This clears the index object in memory; changes must be explicitly written to disk for them to take effect persistently.
an existing index object
0 on success, error code < 0 on failure