public function getSnippet(array $data, $language)
    {
        $parts = array();
        if (isset($data['title'])) {
            // Repeat title twice to make it more important
            $parts = array($data['title'], $data['title']);
        }

        if (isset($data['description'])) {
            $parts[] = strip_tags($data['description']);
        }

        $snippet = $this->filterStopwords(implode(' ', $parts), $language);
        $this->hook->attach('search.index.snippet', $data, $language, $snippet);
        return $snippet;
    }
public function getSnippet(array $data, $language)
    {
        $parts = array();
        if (isset($data['title'])) {
            // Repeat title twice to make it more important
            $parts = array($data['title'], $data['title']);
        }

        if (isset($data['description'])) {
            $parts[] = strip_tags($data['description']);
        }

        $snippet = $this->filterStopwords(implode(' ', $parts), $language);
        $this->hook->attach('search.index.snippet', $data, $language, $snippet);
        return $snippet;
    }
public function getSnippet ( array $ data , $ language ) { $ parts = array ( ) ; if ( isset ( $ data [ 'title' ] ) ) { // Repeat title twice to make it more important $ parts = array ( $ data [ 'title' ] , $ data [ 'title' ] ) ; } if ( isset ( $ data [ 'description' ] ) ) { $ parts [ ] = strip_tags ( $ data [ 'description' ] ) ; } $ snippet = $ this -> filterStopwords ( implode ( ' ' , $ parts ) , $ language ) ; $ this -> hook -> attach ( 'search.index.snippet' , $ data , $ language , $ snippet ) ; return $ snippet ; }
Returns a text string to be saved in the index table
@param array $data
@param string $language
@return string
Returns a text string to be saved in the index table