Class Presentation

  • All Implemented Interfaces:
    Cloneable

    public class Presentation
    extends Object
    implements Cloneable
    Parameters deciding how the result of a query should be presented
    Author:
    Arne Bergene Fossaa
    • Constructor Detail

      • Presentation

        public Presentation​(Query parent)
    • Method Detail

      • getHighlight

        public Highlight getHighlight()
        Returns how terms in this result should be highlighted, or null if not set
      • setHighlight

        public void setHighlight​(Highlight highlight)
        Sets how terms in this result should be highlighted. Set to null to turn highlighting off
      • getSummary

        public String getSummary()
        Returns the name of the summary class to be used to present hits from this query, or null if not set
      • setSummary

        public void setSummary​(String summary)
        Sets the name of the summary class to be used to present hits from this query
      • getBolding

        public boolean getBolding()
        Returns whether matching query terms should be bolded in the result. Default is true.
      • setBolding

        public void setBolding​(boolean bolding)
        Sets whether matching query terms should be bolded in the result
      • getRenderer

        public com.yahoo.component.ComponentSpecification getRenderer()
        Get the name of the format desired for result rendering.
      • setRenderer

        public void setRenderer​(com.yahoo.component.ComponentSpecification format)
        Set the desired format for result rendering. If null, use the default renderer.
      • getFormat

        public String getFormat()
        Get the name of the format desired for result rendering.
      • setFormat

        public void setFormat​(String format)
        Set the desired format for result rendering. If null, use the default renderer.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getTiming

        public boolean getTiming()
        Returns:
        whether to add optional timing data to the rendered result
      • setTiming

        public void setTiming​(boolean timing)
      • getSummaryFields

        public Set<String> getSummaryFields()
        Return the set of explicitly requested fields. Returns an empty set if no fields are specified outside of summary classes. The returned set is mutable and fields may be added or removed before passing on the query.
        Returns:
        the set of names of requested fields, never null
      • prepare

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

        public void setSummaryFields​(String asString)
        Parse the given string as a comma delimited set of field names and overwrite the set of summary fields. Whitespace will be trimmed. If you want to add or remove fields programmatically, use getSummaryFields() and modify the returned set.
        Parameters:
        asString - the summary fields requested, e.g. "price,author,title"