diff --git a/classes/ezfezpsolrquerybuilder.php b/classes/ezfezpsolrquerybuilder.php index 72a99c4c..5c019caf 100644 --- a/classes/ezfezpsolrquerybuilder.php +++ b/classes/ezfezpsolrquerybuilder.php @@ -422,12 +422,16 @@ public function buildSearch( $searchText, $params = array(), $searchTypes = arra $filterQuery = array( $fqString ); } + // Document transformer fields since eZ Find 5.4 + $docTransformerFields = array( '[elevated]' ); + $fieldsToReturnString = eZSolr::getMetaFieldName( 'guid' ) . ' ' . eZSolr::getMetaFieldName( 'installation_id' ) . ' ' . eZSolr::getMetaFieldName( 'main_url_alias' ) . ' ' . eZSolr::getMetaFieldName( 'installation_url' ) . ' ' . eZSolr::getMetaFieldName( 'id' ) . ' ' . eZSolr::getMetaFieldName( 'main_node_id' ) . ' ' . eZSolr::getMetaFieldName( 'language_code' ) . ' ' . eZSolr::getMetaFieldName( 'name' ) . ' score ' . eZSolr::getMetaFieldName( 'published' ) . ' ' . eZSolr::getMetaFieldName( 'path_string' ) . ' ' . eZSolr::getMetaFieldName( 'main_path_string' ) . ' ' . eZSolr::getMetaFieldName( 'is_invisible' ) . ' ' . + implode( ' ', $docTransformerFields) . ' ' . implode( ' ', $extraFieldsToReturn ); if ( ! $asObjects ) diff --git a/classes/ezfindresultnode.php b/classes/ezfindresultnode.php index ff5a9790..fafca310 100644 --- a/classes/ezfindresultnode.php +++ b/classes/ezfindresultnode.php @@ -24,7 +24,9 @@ function eZFindResultNode( $rows = array() ) 'published', 'language_code', 'highlight', - 'score_percent' ); + 'score_percent', + 'elevated' + ); } /*! diff --git a/search/plugins/ezsolr/ezsolr.php b/search/plugins/ezsolr/ezsolr.php index 852341b9..617b460c 100644 --- a/search/plugins/ezsolr/ezsolr.php +++ b/search/plugins/ezsolr/ezsolr.php @@ -1656,6 +1656,7 @@ protected function buildResultObjects( $resultArray, &$searchCount, $asObjects = } $emit['highlight'] = isset( $highLights[$doc[ezfSolrDocumentFieldBase::generateMetaFieldName( 'guid' )]] ) ? $highLights[$doc[ezfSolrDocumentFieldBase::generateMetaFieldName( 'guid' )]] : null; + $emit['elevated'] = ( isset($doc['[elevated]']) ? $doc['[elevated]'] === true : false ); $objectRes[] = $emit; unset( $emit ); continue; @@ -1739,6 +1740,7 @@ protected function buildResultObjects( $resultArray, &$searchCount, $asObjects = */ $maxScore != 0 ? $resultTree->setAttribute( 'score_percent', (int) ( ( $doc['score'] / $maxScore ) * 100 ) ) : $resultTree->setAttribute( 'score_percent', 100 ); $resultTree->setAttribute( 'language_code', $doc[ezfSolrDocumentFieldBase::generateMetaFieldName( 'language_code' )] ); + $resultTree->setAttribute( 'elevated', ( isset($doc['[elevated]']) ? $doc['[elevated]'] === true : false ) ); $objectRes[] = $resultTree; } }