buildExcerpts() public method

Connect to searchd and generate excerpts (snippets) from given documents for a given query
public buildExcerpts ( array $docs, string $index, string $words, array $opts = [] ) : array | false
$docs array array of strings that carry the document contents
$index string name of the index
$words string string that contains the keywords to highlight
$opts array hash which contains additional optional highlighting parameters
return array | false Array of snippets, or false on failure.
Ejemplo n.º 1
0
 public function testBuildExcerptsWithUnicode()
 {
     $sphinx = new SphinxClient();
     $keyword = $this->utf16to8('65e5672c8a9e');
     $results = $sphinx->buildExcerpts(array($keyword), 'sphinxtest', $keyword);
     $this->assertEquals($results, array("<b>{$keyword}</b>"));
 }
 /**
  * {@inheritdoc}
  */
 public function buildExcerpts(array $docs, $index, $words, array $opts = array())
 {
     return $this->proxy->buildExcerpts($docs, $index, $words, $opts);
 }