| org.compass.core.CompassHighlighter
All known Subclasses: org.compass.core.impl.DefaultCompassHighlighter,
Inner Class :final public static class TextTokenizer extends Parameter | |
fragment | String fragment(String propertyName) throws CompassException(Code) | | Returns the best highlighted fragment for the given property name /
meta-data. The highlighted text will be retrived from the index, so it
must be stored.
Note, if there are more than one resource property name / meta-data with
the same name, the text will be taken from the first one.
The name can either be the actual resource property or meta-data value,
or the path to the given resource property (alias.rProperty), or the
class property (alias.cProperty) or the path to the meta-data
(alias.cProperty.metaData)
Parameters: propertyName - The resource property name / meta-data. The best fragment text highlighted. throws: CompassException - |
fragment | String fragment(String propertyName, String text) throws CompassException(Code) | | Returns the best highlighted fragment for the given property name /
meta-data. The given text will be used for highlight. Handy when the text
is not stored in the index.
The name can either be the actual resource property or meta-data value,
or the path to the given resource property (alias.rProperty), or the
class property (alias.cProperty) or the path to the meta-data
(alias.cProperty.metaData)
Parameters: propertyName - The resource property name / meta-data. Parameters: text - The text to be highlighted. The best fragment text highlighted. throws: CompassException - |
fragments | String[] fragments(String propertyName) throws CompassException(Code) | | Returns the best highlighted fragments for the given property name /
meta-data. The highlighted text will be retrived from the index, so it
must be stored.
Note, that the number of fragments will be between 0 and
maxNumFragments .
Note, if there are more than one resource property name / meta-data with
the same name, the text will be taken from the first one.
The name can either be the actual resource property or meta-data value,
or the path to the given resource property (alias.rProperty), or the
class property (alias.cProperty) or the path to the meta-data
(alias.cProperty.metaData)
Parameters: propertyName - The resource property name / meta-data. The best fragments highlighted. throws: CompassException - |
fragments | String[] fragments(String propertyName, String text) throws CompassException(Code) | | Returns the best highlighted fragments for the given property name /
meta-data. The given text will be used for highlight.
Note, that the number of fragments will be between 0 and
maxNumFragments .
The name can either be the actual resource property or meta-data value,
or the path to the given resource property (alias.rProperty), or the
class property (alias.cProperty) or the path to the meta-data
(alias.cProperty.metaData)
Parameters: propertyName - The resource property name / meta-data. Parameters: text - The text to be highlighted. The best fragments highlighted. throws: CompassException - |
fragmentsWithSeparator | String fragmentsWithSeparator(String propertyName) throws CompassException(Code) | | Returns the best highlighted fragments for the given property name /
meta-data, separated with the given separator. The highlighted text will
be retrived from the index, so it must be stored.
Note, that the number of fragments will be between 0 and
maxNumFragments .
Note, if there are more than one resource property name / meta-data with
the same name, the text will be taken from the first one.
The name can either be the actual resource property or meta-data value,
or the path to the given resource property (alias.rProperty), or the
class property (alias.cProperty) or the path to the meta-data
(alias.cProperty.metaData)
Parameters: propertyName - The resource property name / meta-data. The best fragments highlighted and separated. throws: CompassException - |
fragmentsWithSeparator | String fragmentsWithSeparator(String propertyName, String text) throws CompassException(Code) | | Returns the best highlighted fragments for the given property name /
meta-data, separated with the given separator. The given text will be
used for highlight.
Note, that the number of fragments will be between 0 and
maxNumFragments .
The name can either be the actual resource property or meta-data value,
or the path to the given resource property (alias.rProperty), or the
class property (alias.cProperty) or the path to the meta-data
(alias.cProperty.metaData)
Parameters: propertyName - The resource property name / meta-data. Parameters: text - The text to be highlighted. The best fragments highlighted and separated. throws: CompassException - |
multiResourceFragment | String[] multiResourceFragment(String propertyName) throws CompassException(Code) | | Returns the best highlighted fragment of each matching multi resource
property name / meta-data (i.e.: when there is more then one property of the
same name). The highlighted texts will be retrived from the index, so it must
be stored.
Note, that the number of returned fragments is not limited by
maxNumFragments value.
The name can either be the actual resource property or meta-data value,
or the path to the given resource property (alias.rProperty), or the
class property (alias.cProperty) or the path to the meta-data
(alias.cProperty.metaData)
Parameters: propertyName - The resource property name / meta-data. The best fragment texts highlighted. throws: CompassException - |
multiResourceFragment | String[] multiResourceFragment(String propertyName, String[] texts) throws CompassException(Code) | | Returns the best highlighted fragment of each matching multi resource
property name / meta-data (i.e.: when there is more then one property of the
same name). The given texts will be used for highlight. Handy when the texts
are not stored in the index.
Note, that the number of returned fragments is not limited by
maxNumFragments value.
The name can either be the actual resource property or meta-data value,
or the path to the given resource property (alias.rProperty), or the
class property (alias.cProperty) or the path to the meta-data
(alias.cProperty.metaData)
Parameters: propertyName - The resource property name / meta-data. Parameters: texts - Texts to be highlighted. The best fragment texts highlighted. throws: CompassException - |
multiResourceFragmentWithSeparator | String multiResourceFragmentWithSeparator(String propertyName) throws CompassException(Code) | | Returns the best highlighted fragments for the given multi property
name / meta-data, separated with the given separator. The highlighted text
will be retrived from the index, so it must be stored.
Note, that the number of separeted fragments is not
limited by maxNumFragments value.
The name can either be the actual resource property or meta-data value,
or the path to the given resource property (alias.rProperty), or the
class property (alias.cProperty) or the path to the meta-data
(alias.cProperty.metaData)
Parameters: propertyName - The resource property name / meta-data. The best fragments highlighted and separated. throws: CompassException - |
multiResourceFragmentWithSeparator | String multiResourceFragmentWithSeparator(String propertyName, String[] texts) throws CompassException(Code) | | Returns the best highlighted fragments for the given multi property
name / meta-data, separated with the given separator. The given texts will
be used for highlight.
Note, that the number of fragments contained in returned string is not
limited by maxNumFragments value.
The name can either be the actual resource property or meta-data value,
or the path to the given resource property (alias.rProperty), or the
class property (alias.cProperty) or the path to the meta-data
(alias.cProperty.metaData)
Parameters: propertyName - The resource property name / meta-data. Parameters: texts - Texts to be highlighted. The best fragments highlighted and separated. throws: CompassException - |
setAnalyzer | CompassHighlighter setAnalyzer(Resource resource) throws CompassException(Code) | | Sets the analyzer that will be used if analysis of the text is needed
(see
TextTokenizer ). Uses the resource to derive the analyzer
that will be used (works also with per resource property analyzer).
Parameters: resource - The resource to derive the analyzer from the highlighter throws: CompassException - |
setHighlighter | CompassHighlighter setHighlighter(String highlighterName) throws CompassException(Code) | | Sets the highlighter that will be used out the ones set in the
configuration. The highlighters are groups of pre-set configurations for
the sepcified highlighter. The default one is called default .
Parameters: highlighterName - The name of the highlighter that will be used the higlighter throws: CompassException - |
setMaxBytesToAnalyze | CompassHighlighter setMaxBytesToAnalyze(int maxBytesToAnalyze) throws CompassException(Code) | | Sets the maximum number of bytes that will be analyzed for highlighting.
If not set, will use the value configured for the chosen highlighter.
Parameters: maxBytesToAnalyze - The maximum number of bytes analyzed for highlighting the highlighter throws: CompassException - |
setMaxNumFragments | CompassHighlighter setMaxNumFragments(int maxNumFragments) throws CompassException(Code) | | Sets the maximum number of fragments that can be returned or combined to
a separator. If not set, will use the value configured for the chosen
highlighter.
Parameters: maxNumFragments - The maximum number if fragments the highlighter throws: CompassException - |
|
|