From 79c77394f9575cc7fb9068c54d5f6fae13ef8ab7 Mon Sep 17 00:00:00 2001 From: Peter Keung Date: Fri, 23 May 2014 12:49:56 -0700 Subject: [PATCH] Fix for EZP-22924: eZ Find fetch does not respect limitation parameter --- search/plugins/ezsolr/ezsolr.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/search/plugins/ezsolr/ezsolr.php b/search/plugins/ezsolr/ezsolr.php index dd594bfe..c57163a9 100644 --- a/search/plugins/ezsolr/ezsolr.php +++ b/search/plugins/ezsolr/ezsolr.php @@ -976,7 +976,7 @@ function search( $searchText, $params = array(), $searchTypes = array() ) { $searchCount = $resultArray[ 'response' ][ 'numFound' ]; $objectRes = $this->buildResultObjects( - $resultArray, $searchCount, $asObjects, $params['FieldsToReturn'] + $resultArray, $searchCount, $asObjects, $params ); $stopWordArray = array(); @@ -1061,7 +1061,7 @@ function moreLikeThis( $queryType, $queryValue, $params = array() ) { $searchCount = $resultArray[ 'response' ][ 'numFound' ]; $objectRes = $this->buildResultObjects( - $resultArray, $searchCount, $asObjects + $resultArray, $searchCount, $asObjects, $params ); $stopWordArray = array(); @@ -1477,7 +1477,7 @@ public function pushElevateConfiguration() * @see eZSolrBase::search * @see eZSolrBase::moreLikeThis */ - protected function buildResultObjects( $resultArray, &$searchCount, $asObjects = true, $fieldsToReturn = array() ) + protected function buildResultObjects( $resultArray, &$searchCount, $asObjects = true, $params = array() ) { $objectRes = array(); $highLights = array(); @@ -1555,7 +1555,7 @@ protected function buildResultObjects( $resultArray, &$searchCount, $asObjects = } // it may be a field originating from the explicit fieldlist to return, so it should be added for template consumption // note that the fieldname will be kept verbatim in a substructure 'fields' - elseif( in_array( $fieldName, $fieldsToReturn ) ) + elseif( in_array( $fieldName, $params['FieldsToReturn'] ) ) { $emit['fields'][$fieldName] = $fieldValue; }