From f17201367e5d56fe8653710c8a6cdb82219920a4 Mon Sep 17 00:00:00 2001 From: Gethin James Date: Wed, 5 Apr 2017 11:00:25 +0000 Subject: [PATCH] SEARCH-435: Using SolrJSONResultSet git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@136224 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../rest/api/search/impl/ResultMapper.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/source/java/org/alfresco/rest/api/search/impl/ResultMapper.java b/source/java/org/alfresco/rest/api/search/impl/ResultMapper.java index ed7af83ef9..352bbe14c7 100644 --- a/source/java/org/alfresco/rest/api/search/impl/ResultMapper.java +++ b/source/java/org/alfresco/rest/api/search/impl/ResultMapper.java @@ -34,6 +34,7 @@ import org.alfresco.repo.search.impl.solr.facet.facetsresponse.GenericBucket; import org.alfresco.repo.search.impl.solr.facet.facetsresponse.GenericFacetResponse; import org.alfresco.repo.search.impl.solr.facet.facetsresponse.GenericFacetResponse.FACET_TYPE; import org.alfresco.repo.search.impl.solr.facet.facetsresponse.MetricCount; +import org.alfresco.repo.security.permissions.impl.acegi.FilteringResultSet; import org.alfresco.repo.version.Version2Model; import org.alfresco.rest.api.DeletedNodes; import org.alfresco.rest.api.Nodes; @@ -508,17 +509,18 @@ public class ResultMapper */ protected SolrJSONResultSet findSolrResultSet(ResultSet results) { - //This may get more complicated if the results are wrapped in another ResultSet class - if (results instanceof SolrJSONResultSet) + ResultSet theResultSet = results; + + if (results instanceof FilteringResultSet) { - return (SolrJSONResultSet) results; + theResultSet = ((FilteringResultSet) results).getUnFilteredResultSet(); } -/** - if (results instanceof PagingLuceneResultSet) + + if (theResultSet instanceof SolrJSONResultSet) { - return findSolrResultSet(((PagingLuceneResultSet) results).getWrapped()); + return (SolrJSONResultSet) theResultSet; } -**/ + return null; } }