๐Retrieving Top-k Metadata
In a full search pipeline (Scoring โ Decryption โ Metadata retrieval), this is the third and final step.
Once you have plaintext scores (after decryption), you can request the corresponding top-k metadata entries using the get_topk_metadata_results API.
On the server side, the decrypted scores are mapped back to their original IDs, and the top-k relevant metadata is retrieved accordingly.
# Retrieve top-k metadata from decrypted scores
topk_result = search_index.get_topk_metadata_results(
dec_scores, top_k=2, output_fields=["metadata"]
)
print(topk_result)
# [{'id': 1, 'score': 0.9999, 'metadata': 'metadata_0'},
# {'id': 59, 'score': 0.7888, 'metadata': 'metadata_58'}]Last updated

