Package com.yahoo.search.query
Class Presentation
- java.lang.Object
-
- com.yahoo.search.query.Presentation
-
- All Implemented Interfaces:
java.lang.Cloneable
public class Presentation extends java.lang.Object implements java.lang.Cloneable
Parameters deciding how the result of a query should be presented- Author:
- Arne Bergene Fossaa
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
BOLDING
static java.lang.String
FORMAT
The (short) name of the parameter holding the name of the return format to usestatic java.lang.String
PRESENTATION
static java.lang.String
SUMMARY
static java.lang.String
SUMMARY_FIELDS
static java.lang.String
TIMING
-
Constructor Summary
Constructors Constructor Description Presentation(Query parent)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
boolean
equals(java.lang.Object o)
static QueryProfileType
getArgumentType()
boolean
getBolding()
Returns whether matching query terms should be bolded in the result.java.lang.String
getFormat()
Get the name of the format desired for result rendering.Highlight
getHighlight()
Returns how terms in this result should be highlighted, or null if not setcom.yahoo.component.ComponentSpecification
getRenderer()
Get the name of the format desired for result rendering.java.lang.String
getSummary()
Returns the name of the summary class to be used to present hits from this query, or null if not setjava.util.Set<java.lang.String>
getSummaryFields()
Return the set of explicitly requested fields.boolean
getTiming()
int
hashCode()
void
prepare()
Prepares this for binary serialization.void
setBolding(boolean bolding)
Sets whether matching query terms should be bolded in the resultvoid
setFormat(java.lang.String format)
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(java.lang.String summary)
Sets the name of the summary class to be used to present hits from this queryvoid
setSummaryFields(java.lang.String asString)
Parse the given string as a comma delimited set of field names and overwrite the set of summary fields.void
setTiming(boolean timing)
-
-
-
Field Detail
-
PRESENTATION
public static final java.lang.String PRESENTATION
- See Also:
- Constant Field Values
-
BOLDING
public static final java.lang.String BOLDING
- See Also:
- Constant Field Values
-
TIMING
public static final java.lang.String TIMING
- See Also:
- Constant Field Values
-
SUMMARY
public static final java.lang.String SUMMARY
- See Also:
- Constant Field Values
-
SUMMARY_FIELDS
public static final java.lang.String SUMMARY_FIELDS
- See Also:
- Constant Field Values
-
FORMAT
public static final java.lang.String FORMAT
The (short) name of the parameter holding the name of the return format to use- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Presentation
public Presentation(Query parent)
-
-
Method Detail
-
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 java.lang.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(java.lang.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 java.lang.String getFormat()
Get the name of the format desired for result rendering.
-
setFormat
public void setFormat(java.lang.String format)
Set the desired format for result rendering. If null, use the default renderer.
-
clone
public java.lang.Object clone()
- Overrides:
clone
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getTiming
public boolean getTiming()
- Returns:
- whether to add optional timing data to the rendered result
-
setTiming
public void setTiming(boolean timing)
-
getSummaryFields
public java.util.Set<java.lang.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 - seeQuery.prepare()
-
setSummaryFields
public void setSummaryFields(java.lang.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, usegetSummaryFields()
and modify the returned set.- Parameters:
asString
- the summary fields requested, e.g. "price,author,title"
-
-