| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- //
- // $Id$
- //
- require ( "sphinxapi.php" );
- $docs = array
- (
- "this is my test text to be highlighted",
- "this is another test text to be highlighted",
- );
- $words = "test text";
- $index = "test1";
- $opts = array
- (
- "before_match" => "<b>",
- "after_match" => "</b>",
- "chunk_separator" => " ... ",
- "limit" => 400,
- "around" => 15
- );
- $cl = new SphinxClient ();
- $res = $cl->BuildExcerpts ( $docs, $index, $words, $opts );
- if ( !$res )
- {
- die ( "ERROR: " . $cl->GetLastError() . ".\n" );
- } else
- {
- foreach ( $res as $entry )
- {
- $n++;
- print "n=$n, res=$entry\n";
- }
- }
- //
- // $Id$
- //
- ?>
|