nfsantos commented on code in PR #2442: URL: https://github.com/apache/jackrabbit-oak/pull/2442#discussion_r2275586643
########## oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/query/async/facets/ElasticStatisticalFacetAsyncProvider.java: ########## @@ -96,87 +106,120 @@ public class ElasticStatisticalFacetAsyncProvider implements ElasticFacetProvide ) ); - LOG.trace("Kicking search query with random sampling {}", searchRequest); - CompletableFuture<SearchResponse<ObjectNode>> searchFuture = - connection.getAsyncClient().search(searchRequest, ObjectNode.class); - - searchFuture.whenCompleteAsync((searchResponse, throwable) -> { - try { - if (throwable != null) { - LOG.error("Error while retrieving sample documents. Search request: {}", searchRequest, throwable); - } else { - List<Hit<ObjectNode>> searchHits = searchResponse.hits().hits(); - this.sampled = searchHits != null ? searchHits.size() : 0; - if (sampled > 0) { - this.totalHits = searchResponse.hits().total().value(); - processAggregations(searchResponse.aggregations()); - searchResponse.hits().hits().forEach(this::processHit); - computeStatisticalFacets(); - } - } - } finally { - latch.countDown(); - } - }); + this.queryStartTimeNanos = System.nanoTime(); + LOG.trace("Kicking search query with random sampling {}", searchRequest, new Throwable()); Review Comment: Leftover from local debugging during development. I removed logging of the stack trace. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: oak-dev-unsubscr...@jackrabbit.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org