fix: multi result cache duplicates issue (#4413)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit


- **New Features**
- Enhanced response handling by including the histogram interval in
search results.
  
- **Bug Fixes**
- Adjusted hit filtering logic to improve accuracy by changing the
timestamp comparison criteria.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Ashish Kolhe
2024-08-30 17:09:26 +05:30
committed by GitHub
parent a24a330c62
commit 5f8a08f392
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -346,6 +346,7 @@ fn merge_response(
continue;
}
resp.hits.extend(res.hits.clone());
resp.histogram_interval = res.histogram_interval;
}
resp.took = cache_took;
resp
+1 -1
View File
@@ -179,7 +179,7 @@ async fn recursive_process_multiple_metas(
let discard_ts = get_allowed_up_to(&cached_response, &cache_req, discard_duration);
cached_response.hits.retain(|hit| {
let hit_ts = get_ts_value(&cache_req.ts_column, hit);
hit_ts <= hits_allowed_end_time &&
hit_ts < hits_allowed_end_time &&
hit_ts >= hits_allowed_start_time &&
hit_ts < discard_ts
});