How to retrieve list of IDs in an index