Change the output of the search method.

Now returns [{i: index, d: distance}, ...]