programmatic setting of a single index