From 79a9f51f433951f30927e682128435b7da62cda4 Mon Sep 17 00:00:00 2001 From: mohit-singh4 Date: Fri, 20 Dec 2024 15:19:25 +0530 Subject: [PATCH] [fix/APPS-3154] Rectifying number of Files field in response. --- .../node/sizedetails/NodeSizeDetailsServiceImpl.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/repository/src/main/java/org/alfresco/repo/node/sizedetails/NodeSizeDetailsServiceImpl.java b/repository/src/main/java/org/alfresco/repo/node/sizedetails/NodeSizeDetailsServiceImpl.java index 494c8edd175..4def1c40d71 100644 --- a/repository/src/main/java/org/alfresco/repo/node/sizedetails/NodeSizeDetailsServiceImpl.java +++ b/repository/src/main/java/org/alfresco/repo/node/sizedetails/NodeSizeDetailsServiceImpl.java @@ -63,7 +63,6 @@ public class NodeSizeDetailsServiceImpl implements NodeSizeDetailsService, Initi private TransactionService transactionService; private ThreadPoolExecutor threadPoolExecutor; private int defaultItems; - private int totalFiles; public void setSearchService(SearchService searchService) { @@ -101,11 +100,6 @@ public void setDefaultItems(int defaultItems) this.defaultItems = defaultItems; } - public int getTotalFiles() - { - return totalFiles; - } - @Override public void invokeSizeDetailsExecutor(NodeRef nodeRef, String jobId) { @@ -197,7 +191,7 @@ private NodeSizeDetails calculateTotalSizeFromFacet(NodeRef nodeRef, String jobI } Date calculationDate = new Date(System.currentTimeMillis()); NodeSizeDetails nodeSizeDetails = new NodeSizeDetails(nodeRef.getId(), totalSizeFromFacet, calculationDate, - getTotalFiles(), + (int) results.getNumberFound(), STATUS.COMPLETED, jobId); return nodeSizeDetails; } @@ -220,8 +214,7 @@ private ResultSet facetQuery(NodeRef nodeRef) } searchParameters.addFacetQuery(FACET_QUERY); FieldFacet fieldFacet = new FieldFacet(FIELD_FACET); - totalFiles = (int) resultsWithoutFacet.getNumberFound(); - fieldFacet.setLimitOrNull(totalFiles); + fieldFacet.setLimitOrNull((int) resultsWithoutFacet.getNumberFound()); searchParameters.addFieldFacet(fieldFacet); resultsWithoutFacet.close(); return searchService.query(searchParameters);