Skip to content

Commit

Permalink
[fix/APPS-3154] Rectifying number of Files field in response.
Browse files Browse the repository at this point in the history
  • Loading branch information
mohit-singh4 committed Dec 20, 2024
1 parent ab4a39d commit 79a9f51
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
}
Expand All @@ -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);
Expand Down

0 comments on commit 79a9f51

Please sign in to comment.