for i, k in enumerate(ids[vindex]):
if k >= 0:
temp = {"rank": i + 1, "algo": self.name, "dist": float(dist[vindex, i])}
temp.update(self.files[k])
results[vindex].append(temp)
return results
After Change
for vindex in range(ids.shape[0]):
for i, k in enumerate(ids[vindex]):
if k >= 0:
index_entry = sorted(self.tree[k])[0]
temp = {"rank": i + 1, "algo": self.name, "dist": float(dist[vindex, i]),
"indexentries_pk":index_entry.data, "offset":k - index_entry.begin}
results[vindex].append(temp)
return results