Interface IFragmentsBuilder
IFragmentsBuilder is an interface for fragments (snippets) builder classes. A IFragmentsBuilder class can be plugged in to FastVectorHighlighter.
Namespace: Lucene.Net.Search.VectorHighlight
Assembly: Lucene.Net.Highlighter.dll
Syntax
public interface IFragmentsBuilder
Methods
CreateFragment(IndexReader, int, string, FieldFragList)
create a fragment.
Declaration
string CreateFragment(IndexReader reader, int docId, string fieldName, FieldFragList fieldFragList)
Parameters
Type | Name | Description |
---|---|---|
IndexReader | reader | Lucene.Net.Index.IndexReader of the index |
int | docId | document id to be highlighted |
string | fieldName | field of the document to be highlighted |
FieldFragList | fieldFragList | FieldFragList object |
Returns
Type | Description |
---|---|
string | a created fragment or null when no fragment created |
Exceptions
Type | Condition |
---|---|
IOException | If there is a low-level I/O error |
CreateFragment(IndexReader, int, string, FieldFragList, string[], string[], IEncoder)
create a fragment.
Declaration
string CreateFragment(IndexReader reader, int docId, string fieldName, FieldFragList fieldFragList, string[] preTags, string[] postTags, IEncoder encoder)
Parameters
Type | Name | Description |
---|---|---|
IndexReader | reader | Lucene.Net.Index.IndexReader of the index |
int | docId | document id to be highlighted |
string | fieldName | field of the document to be highlighted |
FieldFragList | fieldFragList | FieldFragList object |
string[] | preTags | pre-tags to be used to highlight terms |
string[] | postTags | post-tags to be used to highlight terms |
IEncoder | encoder | an encoder that generates encoded text |
Returns
Type | Description |
---|---|
string | a created fragment or null when no fragment created |
Exceptions
Type | Condition |
---|---|
IOException | If there is a low-level I/O error |
CreateFragments(IndexReader, int, string, FieldFragList, int)
create multiple fragments.
Declaration
string[] CreateFragments(IndexReader reader, int docId, string fieldName, FieldFragList fieldFragList, int maxNumFragments)
Parameters
Type | Name | Description |
---|---|---|
IndexReader | reader | Lucene.Net.Index.IndexReader of the index |
int | docId | document id to be highlighter |
string | fieldName | field of the document to be highlighted |
FieldFragList | fieldFragList | FieldFragList object |
int | maxNumFragments | maximum number of fragments |
Returns
Type | Description |
---|---|
string[] | created fragments or null when no fragments created.
size of the array can be less than |
Exceptions
Type | Condition |
---|---|
IOException | If there is a low-level I/O error |
CreateFragments(IndexReader, int, string, FieldFragList, int, string[], string[], IEncoder)
create multiple fragments.
Declaration
string[] CreateFragments(IndexReader reader, int docId, string fieldName, FieldFragList fieldFragList, int maxNumFragments, string[] preTags, string[] postTags, IEncoder encoder)
Parameters
Type | Name | Description |
---|---|---|
IndexReader | reader | Lucene.Net.Index.IndexReader of the index |
int | docId | document id to be highlighter |
string | fieldName | field of the document to be highlighted |
FieldFragList | fieldFragList | FieldFragList object |
int | maxNumFragments | maximum number of fragments |
string[] | preTags | pre-tags to be used to highlight terms |
string[] | postTags | post-tags to be used to highlight terms |
IEncoder | encoder | an encoder that generates encoded text |
Returns
Type | Description |
---|---|
string[] | created fragments or null when no fragments created.
size of the array can be less than |
Exceptions
Type | Condition |
---|---|
IOException | If there is a low-level I/O error |