Added support for index by ids.