SnippetsOptions Class

Represents the options for building snippets/excerpts.

Definition

Namespace: SphinxConnector.FluentApi
Assembly: SphinxConnector (in SphinxConnector.dll) Version: 6.1.0
C#
[SerializableAttribute]
public class SnippetsOptions
Inheritance
Object    SnippetsOptions

Constructors

SnippetsOptions Initializes a new instance of the SnippetsOptions class.

Properties

AfterMatch Gets or sets the string to insert after a match. Starting with version 1.10-beta, a %PASSAGE_ID% macro can be used in this string. Default is </b>.
AllowEmpty Gets or sets a value indicating whether to allow an empty string to be returned as highlighting result when a snippet could not be generated (no keywords match, or no passages fit the limit). By default, the beginning of original text would be returned instead of an empty string. Default is false. Supported in Sphinx 1.10.1 and above.
Around Gets or sets how much words to pick around each matching keywords block. Default is 5.
BeforeMatch Gets or sets the string to insert before a match. Starting with version 1.10-beta, a %PASSAGE_ID% macro can be used in this string. The macro is replaced with an incrementing passage number within a current snippet. Numbering starts at 1 by default but can be overridden with by setting StartPassageId. In a multi-document call, %PASSAGE_ID% would restart at every given document. Default is <b>.
ChunkSeparator Gets or sets the separator which will be used to separate chunks of text. Default is " ... ".
EmitZones Gets or sets a value indicatin whether to emit an HTML tag with an enclosing zone name before each passage. Default is false. Supported in Sphinx 2.0.1 and above.
ExactPhrase Gets or sets a value indicating whether to highlight exact query phrase matches only instead of individual keywords. Default is false.
ForceAllWords Gets or sets a value indicating whether to ignores the snippet length limit until it includes all the keywords. Default is false. Supported in Sphinx 1.10.1 and above.
HtmlStripMode Gets or sets the HTML strip mode. Default is Index. Supported in Sphinx 1.10.1 and above.
Limit Gets or sets the maximum snippet size. Default is 256.
LimitPassages Limits the maximum number of passages that can be included into the snippet. Default is 0. Supported in Sphinx 1.10.1 and above.
LimitWords Limits the maximum number of keywords that can be included into the snippet. Default is 0. Supported in Sphinx 1.10.1 and above.
LoadFiles Gets or sets a value indicating whether Whether to handle the data parameter of BuildSnippetsTDocument(IEnumerableString, String) as data to extract snippets from (default behavior), or to treat it as file names, and load data from specified files on the server side. Default is false. Supported in Sphinx 1.10.1 and above.
LoadFilesScattered The source files for snippets could be distributed among different agents, and the main daemon will merge together all non-erroneous results. Default is false. Supported in Sphinx 2.0.2 and above.
PassageBoundary Ensures that passages do not cross a sentence, paragraph, or zone boundary (when used with an index that has the respective indexing settings enabled). Supported in Sphinx 2.0.1 and above.
QueryMode Gets or sets a value indicating whether to handle the highlight words parameter of the BuildSnippets method as a query in extended syntax, or as a bag of words (default behavior). Default is false. Supported in Sphinx 1.10.1 and above. This option has been obsoleted in Manticore since 3.2.2.
StartPassageId Specifies the starting value of %PASSAGE_ID% macro (that gets detected and expanded in BeforeMatch, AfterMatch. Default is 1. Supported in Sphinx 1.10.1 and above.
UseBoundaries Gets or sets a value indicating whether to use boundaries. Default is false.
WeightOrder Gets or sets a value indicating whether to sort the extracted passages in order of relevance (decreasing weight), or in order of appearance in the document (increasing position). Default is false.

Methods

EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
ToStringReturns a string that represents the current object.
(Inherited from Object)

See Also