[SEARCH-799] Modified resultMapper in order to always take numberfound from resulset. (#139)

This commit is contained in:
eliaporciani
2019-01-29 12:26:57 +01:00
committed by GitHub
parent 475245d2de
commit 1d13a811a3

View File

@@ -195,18 +195,9 @@ 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);
}
}
return CollectionWithPagingInfo.asPaged(params.getPaging(), noderesults, results.hasMore(), total, null, context);
}