Set index on key and value