Click or drag to resize
SphinxClientBuildExcerpts Method (IEnumerableString, String, String)
Builds excerpts for the given documents using the settings from the given index name and inserting the default values for BeforeMatch and AfterMatch before and after the given highlight words.

Namespace: SphinxConnector.NativeApi
Assembly: SphinxConnector (in SphinxConnector.dll) Version: 3.12.6
Syntax
public IList<string> BuildExcerpts(
	IEnumerable<string> documents,
	string indexName,
	string highlightWords
)

Parameters

documents
Type: System.Collections.GenericIEnumerableString
The documents to build excerpts for.
indexName
Type: SystemString
The name of the index to use settings from.
highlightWords
Type: SystemString
The words to highlight.

Return Value

Type: IListString
An IList<string> containing the excerpts.
Exceptions
ExceptionCondition
ArgumentExceptiondocuments does not contain any elements or indexName is empty.
ArgumentNullExceptiondocuments or indexName is null.
SphinxClientException An error occured while executing the request. See exception message and inner exception for details.
Examples
   SphinxClient sphinxClient = new SphinxClient(); 

   List<string> documents = new List<string>();
   documents.Add("This is my first document.");
   documents.Add("This is my second document.");

   IList<string> result = sphinxClient.BuildExcerpts(documents, "sakila", "is");

   foreach (string entry in result)
   {
       Console.WriteLine(entry);
   }

// This produces the following output:
// 
// This <b>is</b> my first document.
// This <b>is</b> my second document.
See Also