private function getHighlight()
    {
        if (Utils::findKey($this->options, 'highlight', false))
        {
            foreach ($this->fields as $field)
            {
                $this->payload['highlight']['fields'][$field] = new StdClass();
            }

            if ($tag = Utils::findKey($this->options['highlight'], 'tag', false))
            {
                $this->payload['highlight']['pre_tags'] = [$tag];
                $this->payload['highlight']['post_tags'] = [preg_replace('/\A</', '</', $tag)];
            }
        }
    }
private function getHighlight()
    {
        if (Utils::findKey($this->options, 'highlight', false))
        {
            foreach ($this->fields as $field)
            {
                $this->payload['highlight']['fields'][$field] = new StdClass();
            }

            if ($tag = Utils::findKey($this->options['highlight'], 'tag', false))
            {
                $this->payload['highlight']['pre_tags'] = [$tag];
                $this->payload['highlight']['post_tags'] = [preg_replace('/\A</', '</', $tag)];
            }
        }
    }
private function getHighlight ( ) { if ( Utils :: findKey ( $ this -> options , 'highlight' , false ) ) { foreach ( $ this -> fields as $ field ) { $ this -> payload [ 'highlight' ] [ 'fields' ] [ $ field ] = new StdClass ( ) ; } if ( $ tag = Utils :: findKey ( $ this -> options [ 'highlight' ] , 'tag' , false ) ) { $ this -> payload [ 'highlight' ] [ 'pre_tags' ] = [ $ tag ] ; $ this -> payload [ 'highlight' ] [ 'post_tags' ] = [ preg_replace ( '/\A</' , '</' , $ tag ) ] ; } } }
Add requested highlights to the payload
Add requested highlights to the payload