Class DefaultPassageFormatter
Creates a formatted snippet from the top passages.
The default implementation marks the query terms as bold, and places ellipses between unconnected passages.
Inherited Members
Namespace: Lucene.Net.Search.PostingsHighlight
Assembly: Lucene.Net.ICU.dll
Syntax
public class DefaultPassageFormatter : PassageFormatter
Constructors
| Improve this Doc View SourceDefaultPassageFormatter()
Creates a new DefaultPassageFormatter with the default tags.
Declaration
public DefaultPassageFormatter()
DefaultPassageFormatter(String, String, String, Boolean)
Creates a new DefaultPassageFormatter with custom tags.
Declaration
public DefaultPassageFormatter(string preTag, string postTag, string ellipsis, bool escape)
Parameters
Type | Name | Description |
---|---|---|
System.String | preTag | text which should appear before a highlighted term. |
System.String | postTag | text which should appear after a highlighted term. |
System.String | ellipsis | text which should be used to connect two unconnected passages. |
System.Boolean | escape | true if text should be html-escaped |
Fields
| Improve this Doc View Sourcem_ellipsis
text that will appear between two unconnected passages
Declaration
protected readonly string m_ellipsis
Field Value
Type | Description |
---|---|
System.String |
m_escape
true if we should escape for html
Declaration
protected readonly bool m_escape
Field Value
Type | Description |
---|---|
System.Boolean |
m_postTag
text that will appear after highlighted terms
Declaration
protected readonly string m_postTag
Field Value
Type | Description |
---|---|
System.String |
m_preTag
text that will appear before highlighted terms
Declaration
protected readonly string m_preTag
Field Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceAppend(StringBuilder, String, Int32, Int32)
Appends original text to the response.
Declaration
protected virtual void Append(StringBuilder dest, string content, int start, int end)
Parameters
Type | Name | Description |
---|---|---|
System.Text.StringBuilder | dest | resulting text, possibly transformed or encoded |
System.String | content | original text content |
System.Int32 | start | index of the first character in content |
System.Int32 | end | index of the character following the last character in content |
Format(Passage[], String)
Declaration
public override object Format(Passage[] passages, string content)
Parameters
Type | Name | Description |
---|---|---|
Passage[] | passages | |
System.String | content |
Returns
Type | Description |
---|---|
System.Object |