Class Highlight

  • All Implemented Interfaces:
    Cloneable

    public class Highlight
    extends Object
    implements Cloneable
    Class encapsulating information on extra highlight-terms for a query
    Author:
    Mathias Lidal
    • Field Detail

      • HIGHLIGHTTERMS

        public static final String HIGHLIGHTTERMS
        The name of the property map which contains extra highlight terms
        See Also:
        Constant Field Values
    • Constructor Detail

      • Highlight

        public Highlight()
    • Method Detail

      • addHighlightTerm

        public void addHighlightTerm​(String field,
                                     String item)
        Add custom highlight term
        Parameters:
        field - the field name
        item - the term to be highlighted
      • addHighlightPhrase

        public void addHighlightPhrase​(String field,
                                       List<String> phrase)
        Add custom highlight phrase
        Parameters:
        field - the field name
        phrase - the list of terms to be highlighted as a phrase
      • getHighlightItems

        public Map<String,​AndItem> getHighlightItems()
        Returns the modifiable map of highlight items (never null)
      • prepare

        public void prepare()
        Prepares this for binary serialization. For internal use - see Query.prepare()