Class HighlightInfo

java.lang.Object
org.codelibs.fess.entity.HighlightInfo

public class HighlightInfo extends Object
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 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

      public String getType()
      Gets the highlighting type.
      Returns:
      the highlighting type
    • type

      public HighlightInfo type(String 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

      public HighlightInfo fragmentSize(int 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

      public HighlightInfo numOfFragments(int 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

      public HighlightInfo fragmentOffset(int fragmentOffset)
      Sets the fragment offset with fluent interface.
      Parameters:
      fragmentOffset - the fragment offset value
      Returns:
      this HighlightInfo instance for method chaining
    • getPreTags

      public String[] getPreTags()
      Gets the custom pre-tags for highlighting.
      Returns:
      the pre-tags array, or null if using defaults
    • preTags

      public HighlightInfo preTags(String... 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

      public String[] getPostTags()
      Gets the custom post-tags for highlighting.
      Returns:
      the post-tags array, or null if using defaults
    • postTags

      public HighlightInfo postTags(String... 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