Method GetBestFragment
GetBestFragment(FieldQuery, IndexReader, Int32, String, Int32)
return the best fragment.
Declaration
public string GetBestFragment(FieldQuery fieldQuery, IndexReader reader, int docId, string fieldName, int fragCharSize)
Parameters
Type | Name | Description |
---|---|---|
FieldQuery | fieldQuery | FieldQuery object |
IndexReader | reader | |
System.Int32 | docId | document id to be highlighted |
System.String | fieldName | field of the document to be highlighted |
System.Int32 | fragCharSize | the length (number of chars) of a fragment |
Returns
Type | Description |
---|---|
System.String | the best fragment (snippet) string |
GetBestFragment(FieldQuery, IndexReader, Int32, String, Int32, IFragListBuilder, IFragmentsBuilder, String[], String[], IEncoder)
return the best fragment.
Declaration
public string GetBestFragment(FieldQuery fieldQuery, IndexReader reader, int docId, string fieldName, int fragCharSize, IFragListBuilder fragListBuilder, IFragmentsBuilder fragmentsBuilder, string[] preTags, string[] postTags, IEncoder encoder)
Parameters
Type | Name | Description |
---|---|---|
FieldQuery | fieldQuery | FieldQuery object |
IndexReader | reader | |
System.Int32 | docId | document id to be highlighted |
System.String | fieldName | field of the document to be highlighted |
System.Int32 | fragCharSize | the length (number of chars) of a fragment |
IFragListBuilder | fragListBuilder | IFragListBuilder object |
IFragmentsBuilder | fragmentsBuilder | IFragmentsBuilder object |
System.String[] | preTags | pre-tags to be used to highlight terms |
System.String[] | postTags | post-tags to be used to highlight terms |
IEncoder | encoder | an encoder that generates encoded text |
Returns
Type | Description |
---|---|
System.String | the best fragment (snippet) string |