When a search query returns millions of candidate documents, further processing becomes unnecessarily slow. In many cases, a smaller random sample (e.g., 1 000 instead of 1 000 000) preserves the statistical properties of the full result set while drastically reducing compute cost.
This PR introduces a Downsample parameter in SearchParams. If >1, the search pipeline randomly keeps only ~1/Downsample of LIDs before fetching MIDs/RIDs.
When a search query returns millions of candidate documents, further processing becomes unnecessarily slow. In many cases, a smaller random sample (e.g., 1 000 instead of 1 000 000) preserves the statistical properties of the full result set while drastically reducing compute cost.
This PR introduces a Downsample parameter in SearchParams. If >1, the search pipeline randomly keeps only ~1/Downsample of LIDs before fetching MIDs/RIDs.