Class Presentation

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

  • Constructor Details

    • Presentation

      public Presentation(Query parent)
  • Method Details

    • getArgumentType

      public static QueryProfileType getArgumentType()
    • 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.
    • clone

      public Object clone()
      Overrides:
      clone 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
    • 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"
    • getTensorShortForm

      public boolean getTensorShortForm()
      Returns whether tensors should use short form in JSON and textual representations, see https://docs.vespa.ai/en/reference/document-json-format.html#tensor and https://docs.vespa.ai/en/reference/tensor.html#tensor-literal-form. Default is true.
    • setTensorShortForm

      public void setTensorShortForm(String value)
      Sets whether tensors should use short form in JSON and textual representations from a string.
      Parameters:
      value - a string which must be either 'short' or 'long'
      Throws:
      IllegalArgumentException - if any other value is passed
    • setTensorShortForm

      public void setTensorShortForm(boolean tensorShortForm)
    • prepare

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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object