There is a lot of repeated test setup that should be factored out, either using a TEST_F fixture, or by calling helper methods. There are a lot of cases with different index types (unique, non-unique, _id unique) and conditions (end point set / not set, iterating with KeyString interface vs not), etc.
The goal of the refactoring should be to make it clearer what we test, and ideally fixing unintentional omissions.