Class Highlight

  • All Implemented Interfaces:
    java.lang.Cloneable

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

      Fields 
      Modifier and Type Field Description
      static java.lang.String HIGHLIGHTTERMS
      The name of the property map which contains extra highlight terms
    • Constructor Summary

      Constructors 
      Constructor Description
      Highlight()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addHighlightPhrase​(java.lang.String field, java.util.List<java.lang.String> phrase)
      Add custom highlight phrase
      void addHighlightTerm​(java.lang.String field, java.lang.String item)
      Add custom highlight term
      Highlight clone()  
      java.util.Map<java.lang.String,​AndItem> getHighlightItems()
      Returns the modifiable map of highlight items (never null)
      java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getHighlightTerms()  
      void prepare()
      Prepares this for binary serialization.
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • HIGHLIGHTTERMS

        public static final java.lang.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​(java.lang.String field,
                                     java.lang.String item)
        Add custom highlight term
        Parameters:
        field - Field name
        item - Term to be highlighted
      • addHighlightPhrase

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

        public java.util.Map<java.lang.String,​AndItem> getHighlightItems()
        Returns the modifiable map of highlight items (never null)
        Returns:
        Map of highlight items
      • clone

        public Highlight clone()
        Overrides:
        clone in class java.lang.Object
      • getHighlightTerms

        public java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getHighlightTerms()
      • prepare

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