How to retrieve list of IDs in an index

A post was merged into an existing topic: Getting the IDs of all records in a namespace