original_string: public function merge_highlight_field_values($doc, $highlighteddoc) {
  
          foreach ($this->highlightfields as $field) {
              if (!empty($doc->$field)) {
  
                  // Check that the returned value is not an array. No way we can make this work with multivalued solr fields.
                  if (is_array($doc->{$field})) {
                      throw new \core_search\engine_exception('multivaluedfield', 'search_solr', '', $field);
                  }
  
                  if (!empty($highlighteddoc->$field)) {
                      // Replace by the highlighted result.
                      $doc->$field = reset($highlighteddoc->$field);
                  }
              }
          }
      }
code: public function merge_highlight_field_values($doc, $highlighteddoc) {
  
          foreach ($this->highlightfields as $field) {
              if (!empty($doc->$field)) {
  
                  // Check that the returned value is not an array. No way we can make this work with multivalued solr fields.
                  if (is_array($doc->{$field})) {
                      throw new \core_search\engine_exception('multivaluedfield', 'search_solr', '', $field);
                  }
  
                  if (!empty($highlighteddoc->$field)) {
                      // Replace by the highlighted result.
                      $doc->$field = reset($highlighteddoc->$field);
                  }
              }
          }
      }
code_tokens: public function merge_highlight_field_values ( $ doc , $ highlighteddoc ) { foreach ( $ this -> highlightfields as $ field ) { if ( ! empty ( $ doc -> $ field ) ) { // Check that the returned value is not an array. No way we can make this work with multivalued solr fields. if ( is_array ( $ doc -> { $ field } ) ) { throw new \ core_search \ engine_exception ( 'multivaluedfield' , 'search_solr' , '' , $ field ) ; } if ( ! empty ( $ highlighteddoc -> $ field ) ) { // Replace by the highlighted result. $ doc -> $ field = reset ( $ highlighteddoc -> $ field ) ; } } } }
docstring: Adds the highlighting array values to docs array values.
  
  @throws \core_search\engine_exception
  @param object $doc containing the results.
  @param object $highlighteddoc containing the highlighted results values.
docstring_tokens: Adds the highlighting array values to docs array values .