From 1d13a811a3cf992e7d24e2a39439b244573f6ef9 Mon Sep 17 00:00:00 2001 From: eliaporciani Date: Tue, 29 Jan 2019 12:26:57 +0100 Subject: [PATCH] [SEARCH-799] Modified resultMapper in order to always take numberfound from resulset. (#139) --- .../alfresco/rest/api/search/impl/ResultMapper.java | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/main/java/org/alfresco/rest/api/search/impl/ResultMapper.java b/src/main/java/org/alfresco/rest/api/search/impl/ResultMapper.java index 9206a4d2e2..6ebba523bd 100644 --- a/src/main/java/org/alfresco/rest/api/search/impl/ResultMapper.java +++ b/src/main/java/org/alfresco/rest/api/search/impl/ResultMapper.java @@ -195,19 +195,10 @@ public class ResultMapper { //We used Solr for this query context = toSearchContext(solrResultSet, searchRequestContext, searchQuery, notFound); - total = setTotal(solrResultSet); - } - else - { - //This probably wasn't solr - if (!results.hasMore()) - { - //If there are no more results then we are confident that the number found is correct - //otherwise we are not confident enough that its accurate - total = setTotal(results); - } } + total = setTotal(results); + return CollectionWithPagingInfo.asPaged(params.getPaging(), noderesults, results.hasMore(), total, null, context); }