Class SnippetOptions
- Namespace
- TantivyDotNet
- Assembly
- TantivyDotNet.dll
Asks Search(Query, SearchOptions) to compute a Snippet for each hit, for each of Fields.
public sealed class SnippetOptions
- Inheritance
-
SnippetOptions
- Inherited Members
Examples
var results = searcher.Search(query, new SearchOptions { Snippets = new SnippetOptions("body") { MaxLength = 200 } });
string html = results[0].Snippets["body"].ToHtml();
Constructors
- SnippetOptions(params IEnumerable<string>)
Requests snippets for
fields.
Properties
- Fields
The fields to make snippets of.
- MaxLength
The longest fragment to return, measured in UTF-8 bytes of the field text (so text that isn't ASCII gets fewer characters). Default 150.