more accurate estimate
@@ -21,7 +21,11 @@ NearestNeighborBlueprint::NearestNeighborBlueprint(const queryeval::FieldSpec& f
_distance_heap(target_num_hits),
_found_hits()
{
- setEstimate(HitEstimate(_attr_tensor.getNumDocs(), false));
+ uint32_t est_hits = _attr_tensor.getNumDocs();
+ if (_attr_tensor.nearest_neighbor_index()) {
+ est_hits = std::min(target_num_hits, est_hits);
+ }
+ setEstimate(HitEstimate(est_hits, false));
}
NearestNeighborBlueprint::~NearestNeighborBlueprint() = default;
