Class Highlight

java.lang.Object
com.yahoo.prelude.query.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 Details

    • HIGHLIGHTTERMS

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

    • Highlight

      public Highlight()
  • Method Details

    • 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)
    • clone

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

      public Map<String,List<String>> getHighlightTerms()
    • prepare

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