Module
Highlight
Highlight ( fields )
Allows to highlight search results on one or more fields.
|
Method Summary
Returns | Name | Description |
---|---|---|
String | _type() | The type of ejs object. For internal use only. |
Object | boundaryChars(charStr,oField) | Set's the boundary characters. When highlighting a field that is
mapped with term vectors, boundary_chars can be configured to
define what constitutes a boundary for highlighting. It’s a single
string with each boundary character defined in it. You can apply
the option to a specific field by passing the field name in to
the oField parameter. It defaults to ".,!? \t\n". |
Object | boundaryMaxScan(cnt,oField) | Sets the max number of characters to scan while looking for the
start of a boundary character. You can apply the option to a
specific field by passing the field name in to the
oField parameter. Default: 20 |
Object | encoder(e) | Sets highlight encoder. Valid values are: default - the default, no encoding html - to encode html characters if you use html tags |
Object | fields(vals) | Allows you to set the fields that will be highlighted. You can specify a single field or an array of fields. All fields are added to the current list of fields. |
Object | fragmenter(f,oField) | Sets the fragmenter type. You can apply the option
to a specific field by passing the field name in to the
oField parameter. Valid values for order are:
simple - breaks text up into same-size fragments with no concerns
over spotting sentence boundaries.
span - breaks text up into same-size fragments but does not split
up Spans. |
Object | fragmentSize(size,oField) | Sets the size of each highlight fragment in characters.
You can apply the option to a specific field by passing the field
name in to the oField parameter. Default: 100 |
Object | highlightFilter(trueFalse,oField) | Enables highlights in documents matched by a filter.
You can apply the option to a specific field by passing the field
name in to the oField parameter. Defaults to false. |
Object | numberOfFragments(cnt,oField) | Sets the number of highlight fragments.
You can apply the option to a specific field by passing the field
name in to the oField parameter. Default: 5 |
Object | options(opts,oField) | Sets arbitrary options that can be passed to the highlighter implementation in use. |
Object | order(o,oField) | Sets the order of highlight fragments. You can apply the option
to a specific field by passing the field name in to the
oField parameter. Valid values for order are:
score - the score calculated by Lucene's highlighting framework. |
Object | postTags(tags,oField) | Sets the post tags for highlighted fragments. You can apply the
tags to a specific field by passing the field name in to the
oField parameter. |
Object | preTags(tags,oField) | Sets the pre tags for highlighted fragments. You can apply the
tags to a specific field by passing the field name in to the
oField parameter. |
Object | requireFieldMatch(trueFalse,oField) | When enabled it will cause a field to be highlighted only if a
query matched that field. false means that terms are highlighted
on all requested fields regardless if the query matches
specifically on them. You can apply the option to a specific
field by passing the field name in to the oField
parameter. Defaults to false. |
Object | tagsSchema(s) | Sets the schema to be used for the tags. Valid values are: styled - 10 pre tags with css class of hltN, where N is 1-10 |
String | toJSON() | Retrieves the internal script object. This is typically used by
internal API functions so use with caution. |
Object | type(t,oField) | Sets the highligher type. You can apply the option
to a specific field by passing the field name in to the
oField parameter. Valid values for order are:
plain - the slower Lucene standard highligher
postings - the postings highligher
fvh - the fast vector based highligher |
Method Detail
boundaryChars
Object boundaryChars ( charStr, oField )
Set's the boundary characters. When highlighting a field that is
mapped with term vectors, boundary_chars can be configured to
define what constitutes a boundary for highlighting. It’s a single
string with each boundary character defined in it. You can apply
the option to a specific field by passing the field name in to
the oField parameter. It defaults to ".,!? \t\n".
|
boundaryMaxScan
Object boundaryMaxScan ( cnt, oField )
Sets the max number of characters to scan while looking for the
start of a boundary character. You can apply the option to a
specific field by passing the field name in to the
oField parameter. Default: 20
|
encoder
Object encoder ( e )
Sets highlight encoder. Valid values are:
default - the default, no encoding
html - to encode html characters if you use html tags
|
fields
Object fields ( vals )
Allows you to set the fields that will be highlighted. You can
specify a single field or an array of fields. All fields are
added to the current list of fields.
|
fragmenter
Object fragmenter ( f, oField )
Sets the fragmenter type. You can apply the option
to a specific field by passing the field name in to the
oField parameter. Valid values for order are:
simple - breaks text up into same-size fragments with no concerns
over spotting sentence boundaries.
span - breaks text up into same-size fragments but does not split
up Spans.
|
fragmentSize
Object fragmentSize ( size, oField )
Sets the size of each highlight fragment in characters.
You can apply the option to a specific field by passing the field
name in to the oField parameter. Default: 100
|
highlightFilter
Object highlightFilter ( trueFalse, oField )
Enables highlights in documents matched by a filter.
You can apply the option to a specific field by passing the field
name in to the oField parameter. Defaults to false.
|
numberOfFragments
Object numberOfFragments ( cnt, oField )
Sets the number of highlight fragments.
You can apply the option to a specific field by passing the field
name in to the oField parameter. Default: 5
|
options
Object options ( opts, oField )
Sets arbitrary options that can be passed to the highlighter
implementation in use.
|
order
Object order ( o, oField )
Sets the order of highlight fragments. You can apply the option
to a specific field by passing the field name in to the
oField parameter. Valid values for order are:
score - the score calculated by Lucene's highlighting framework.
|
postTags
Object postTags ( tags, oField )
Sets the post tags for highlighted fragments. You can apply the
tags to a specific field by passing the field name in to the
oField parameter.
|
preTags
Object preTags ( tags, oField )
Sets the pre tags for highlighted fragments. You can apply the
tags to a specific field by passing the field name in to the
oField parameter.
|
requireFieldMatch
Object requireFieldMatch ( trueFalse, oField )
When enabled it will cause a field to be highlighted only if a
query matched that field. false means that terms are highlighted
on all requested fields regardless if the query matches
specifically on them. You can apply the option to a specific
field by passing the field name in to the oField
parameter. Defaults to false.
|
toJSON
String toJSON ( )
Retrieves the internal script object. This is typically used by
internal API functions so use with caution.
|
type
Object type ( t, oField )
Sets the highligher type. You can apply the option
to a specific field by passing the field name in to the
oField parameter. Valid values for order are:
plain - the slower Lucene standard highligher
postings - the postings highligher
fvh - the fast vector based highligher
|