Add support for specifying index