Skip to content

Commit

Permalink
resolved more comments on my PR
Browse files Browse the repository at this point in the history
Signed-off-by: Ronnak Saxena <[email protected]>
  • Loading branch information
ronnaksaxena committed Sep 7, 2023
1 parent d618e90 commit 9c567ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ class ResponseInterceptor(
.source(searchSourceBuilder)
/*
If the response shard index is a rollup index, need to find the minimum value of all the live indices to compute the overlap
This is because I am comparing this index to all the live data to compute the interval I want to keep
If the response shard index is a live index, need to only compute minimum value of the current shard index
*/
if (isShardIndexRollup) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,10 @@ class RollupInterceptor(
// Only modifies rollup searches and avoids internal client calls
if (containsRollup || isRollupIndex) {
val (concreteRollupIndicesArray, concreteLiveIndicesArray) = getConcreteIndices(request)
// Avoid infinite interceptor loop
/* Avoid infinite interceptor loop:
if there is an internal client call made in the reponse interceptor there is only 1 index.
Therefore, conditions are not met for api to combine rollup and live data
*/
val isMultiSearch = (concreteRollupIndicesArray.isNotEmpty() && concreteLiveIndicesArray.isNotEmpty())
if (isMultiSearch && request.source().aggregations() != null && !isRequestRewrittenIntoBuckets(request)) {
// Break apart request to remove overlapping parts
Expand Down

0 comments on commit 9c567ee

Please sign in to comment.