diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/interceptor/ResponseInterceptor.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/interceptor/ResponseInterceptor.kt index 0e279c22c..27fabd310 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/interceptor/ResponseInterceptor.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/interceptor/ResponseInterceptor.kt @@ -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) { diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/interceptor/RollupInterceptor.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/interceptor/RollupInterceptor.kt index d7c15e460..85f28a9a9 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/interceptor/RollupInterceptor.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/interceptor/RollupInterceptor.kt @@ -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