Implemented reindex command.