Iterate over an index optionally starting from some given term.
Note that unordered indexes (like HashIndex) has undefined behaviour with this method.
The index to iterate over
The term to start from or
Called for each term in the index
Arbitrary data to pass back to