Package com.yahoo.search.query
Class Presentation
java.lang.Object
com.yahoo.search.query.Presentation
- All Implemented Interfaces:
Cloneable
Parameters deciding how the result of a query should be presented
- Author:
- Arne Bergene Fossaa
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
boolean
static QueryProfileType
boolean
Returns whether matching query terms should be bolded in the result.Get the name of the format desired for result rendering.Returns how terms in this result should be highlighted, or null if not setcom.yahoo.component.ComponentSpecification
Get the name of the format desired for result rendering.Returns the name of the summary class to be used to present hits from this query, or null if not setReturn the set of explicitly requested fields.boolean
Returns whether tensor content should be rendered directly, or inside a JSON object containing a "type" entry having the tensor type, and a "cells"/"values"/"blocks" entry (depending on type), having the tensor content.boolean
Returns whether tensors should use short form in JSON and textual representations, see https://docs.vespa.ai/en/reference/document-json-format.html#tensor.boolean
Returns whether to add optional timing data to the rendered result.int
hashCode()
void
prepare()
Prepares this for binary serialization.void
setBolding
(boolean bolding) Sets whether matching query terms should be bolded in the resultvoid
Set the desired format for result rendering.void
setHighlight
(Highlight highlight) Sets how terms in this result should be highlighted.void
setRenderer
(com.yahoo.component.ComponentSpecification format) Set the desired format for result rendering.void
setSummary
(String summary) Sets the name of the summary class to be used to present hits from this queryvoid
setSummaryFields
(String asString) Parse the given string as a comma delimited set of field names and overwrite the set of summary fields.void
setTensorDirectValues
(boolean tensorDirectValues) void
setTensorFormat
(String value) Sets whether tensors should use short form in JSON and textual representations from a string.void
setTensorShortForm
(boolean tensorShortForm) void
setTensorShortForm
(String value) Deprecated.use setTensorFormat().void
setTiming
(boolean timing)
-
Field Details
-
PRESENTATION
- See Also:
-
BOLDING
- See Also:
-
TIMING
- See Also:
-
SUMMARY
- See Also:
-
SUMMARY_FIELDS
- See Also:
-
TENSORS
- See Also:
-
FORMAT
The (short) name of the parameter holding the name of the return format to use- See Also:
-
-
Constructor Details
-
Presentation
-
-
Method Details
-
getArgumentType
-
getHighlight
Returns how terms in this result should be highlighted, or null if not set -
setHighlight
Sets how terms in this result should be highlighted. Set to null to turn highlighting off -
getSummary
Returns the name of the summary class to be used to present hits from this query, or null if not set -
setSummary
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
Get the name of the format desired for result rendering. -
setFormat
Set the desired format for result rendering. If null, use the default renderer. -
clone
-
getTiming
public boolean getTiming()Returns whether to add optional timing data to the rendered result. -
setTiming
public void setTiming(boolean timing) -
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
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, usegetSummaryFields()
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. Default is true. -
setTensorShortForm
Deprecated.use setTensorFormat(). -
setTensorFormat
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) -
getTensorDirectValues
public boolean getTensorDirectValues()Returns whether tensor content should be rendered directly, or inside a JSON object containing a "type" entry having the tensor type, and a "cells"/"values"/"blocks" entry (depending on type), having the tensor content. See https://docs.vespa.ai/en/reference/document-json-format.html#tensor. Default is false: Render wrapped in a JSON object. -
setTensorDirectValues
public void setTensorDirectValues(boolean tensorDirectValues) -
prepare
public void prepare()Prepares this for binary serialization. For internal use - seeQuery.prepare()
-
equals
-
hashCode
public int hashCode()
-