| StringExtensionsGetSnippet Method (String, SnippetsOptions) |
Gets a snippet for an attribute or a string for the match clause provided to
Match(String).
Supported with Manticore 3.2.2 and up.
Namespace:
SphinxConnector.FluentApi.Util
Assembly:
SphinxConnector (in SphinxConnector.dll) Version: 5.4.1
Syntax public static string GetSnippet(
this string highlightSource,
SnippetsOptions options
)
<ExtensionAttribute>
Public Shared Function GetSnippet (
highlightSource As String,
options As SnippetsOptions
) As String
Parameters
- highlightSource
- Type: SystemString
The attribute or text to highlight. - options
- Type: SphinxConnector.FluentApiSnippetsOptions
The options for building the Snippet. Supported with Sphinx 2.2.1 and Manticore.
Return Value
Type:
StringThe highlighted text.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
String. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
Examples using (IFulltextSession fulltextSession = fulltextStore.StartSession())
{
var results = fulltextSession.Query<Product>().
Match("my query").
Select(product => new
{
product.Id,
product.Name,
Snippet = product.Description.GetSnippet()
}).ToList();
}
See Also