Package org.codelibs.fess.entity
Class HighlightInfo
java.lang.Object
org.codelibs.fess.entity.HighlightInfo
Entity class containing highlighting configuration for search result text highlighting.
This class manages highlighting parameters such as fragment size, number of fragments,
and highlighting type for displaying search query matches in result snippets.
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor that initializes highlighting settings from Fess configuration. -
Method Summary
Modifier and TypeMethodDescriptionfragmentOffset(int fragmentOffset) Sets the fragment offset with fluent interface.fragmentSize(int fragmentSize) Sets the fragment size with fluent interface.intGets the fragment offset.intGets the fragment size.intGets the number of fragments.String[]Gets the custom post-tags for highlighting.String[]Gets the custom pre-tags for highlighting.getType()Gets the highlighting type.numOfFragments(int numOfFragments) Sets the number of fragments with fluent interface.Sets the custom post-tags for highlighting with fluent interface.Sets the custom pre-tags for highlighting with fluent interface.Sets the highlighting type with fluent interface.
-
Constructor Details
-
HighlightInfo
public HighlightInfo()Default constructor that initializes highlighting settings from Fess configuration. Loads default values for type, fragment size, number of fragments, and fragment offset.
-
-
Method Details
-
getType
Gets the highlighting type.- Returns:
- the highlighting type
-
type
Sets the highlighting type with fluent interface.- Parameters:
type- the highlighting type to set- Returns:
- this HighlightInfo instance for method chaining
-
getFragmentSize
public int getFragmentSize()Gets the fragment size.- Returns:
- the fragment size in characters
-
fragmentSize
Sets the fragment size with fluent interface.- Parameters:
fragmentSize- the fragment size in characters- Returns:
- this HighlightInfo instance for method chaining
-
getNumOfFragments
public int getNumOfFragments()Gets the number of fragments.- Returns:
- the maximum number of highlighted fragments
-
numOfFragments
Sets the number of fragments with fluent interface.- Parameters:
numOfFragments- the maximum number of highlighted fragments- Returns:
- this HighlightInfo instance for method chaining
-
getFragmentOffset
public int getFragmentOffset()Gets the fragment offset.- Returns:
- the fragment offset value
-
fragmentOffset
Sets the fragment offset with fluent interface.- Parameters:
fragmentOffset- the fragment offset value- Returns:
- this HighlightInfo instance for method chaining
-
getPreTags
Gets the custom pre-tags for highlighting.- Returns:
- the pre-tags array, or null if using defaults
-
preTags
Sets the custom pre-tags for highlighting with fluent interface.- Parameters:
preTags- the pre-tags to set- Returns:
- this HighlightInfo instance for method chaining
-
getPostTags
Gets the custom post-tags for highlighting.- Returns:
- the post-tags array, or null if using defaults
-
postTags
Sets the custom post-tags for highlighting with fluent interface.- Parameters:
postTags- the post-tags to set- Returns:
- this HighlightInfo instance for method chaining
-