Package com.attivio.sdk.search.fields
Class Teaser
- java.lang.Object
-
- com.attivio.sdk.search.fields.FieldExpression
-
- com.attivio.sdk.search.fields.UnaryFieldExpression
-
- com.attivio.sdk.search.fields.Teaser
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
- Direct Known Subclasses:
ScopeTeaser
public class Teaser extends UnaryFieldExpression
Computes a dynamic teaser.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.attivio.sdk.search.fields.FieldExpression
FieldExpression.StringMode
-
-
Field Summary
-
Fields inherited from class com.attivio.sdk.search.fields.UnaryFieldExpression
expression
-
Fields inherited from class com.attivio.sdk.search.fields.FieldExpression
EMPTY_ARRAY
-
-
Constructor Summary
Constructors Constructor Description Teaser(FieldExpression expression)
Teaser(java.lang.String fieldName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Teaser
clone()
boolean
equals(java.lang.Object other)
FieldExpression
forEachQuery(QueryHandler handler)
Applieshandler
for eachQuery
argument.java.lang.String
getFallbackField()
Get the fallback field.java.lang.String
getFragmentScope()
Get the name of the scope to use for fragmenting.java.lang.Integer
getFragmentSize()
Get the size of generated fragments.HighlightMode
getHighlightMode()
Get the mode for annotating scopes.java.lang.String
getHighlightScope()
Get the scope name to annotate phrase matches with.java.lang.String
getMatchScope()
Get the scope name to annotate atomic matches with.java.lang.Integer
getNumFragments()
Get the number of framents to generate (if fragmenting).Query
getQuery()
Get the query to use for highlighting.Query
getQuery(Query defaultQuery)
Get the query to use for highlighting.java.lang.String
getSeparator()
Get the markup to insert between generated fragments.java.lang.String
getTokenizer()
Get the name of the tokenizer to use for highlighting.SchemaField.Type
getType(Schema schema)
Resolve the type for this expression.java.lang.String[]
getWhitelist()
Get the fields to extract query terms from.int
hashCode()
boolean
isConstant()
Returnstrue
if this field expression evaluates to a constant value.java.lang.Boolean
isFragment()
Get if the teaser should be fragmented.java.lang.Boolean
isMergeFragments()
Get if fragments should be merged.void
rewrite(QueryHandler handler, boolean recursive)
Rewrite any query objects in this FieldExpression usinghandler
.void
setFallbackField(java.lang.String field)
Set the fallback field (to use if highlighting yields no text).void
setFragment(java.lang.Boolean value)
Set if the teaser should be fragmented.void
setFragmentScope(java.lang.String value)
Set the name of the scope to use for fragmenting.void
setFragmentSize(java.lang.Integer value)
Set the size of generated fragments.void
setHighlightMode(HighlightMode value)
Set the mode for annotating scopes.void
setHighlightScope(java.lang.String value)
Set the scope name to annotate phrase matches with.void
setMatchScope(java.lang.String value)
Set the scope name to annotate atomic matches with.void
setMergeFragments(java.lang.Boolean value)
Set if fragments should be merged.void
setNumFragments(java.lang.Integer value)
Set the number of framents to generate (if fragmenting).protected void
setParameters(StringParser reader)
void
setQuery(Query value)
Set the query to use for highlightingvoid
setSeparator(java.lang.String value)
Set the markup to insert between generated fragments.void
setTokenizer(java.lang.String tokenizer)
Set the tokenizer to use for highlighting.void
setWhitelist(java.lang.String... whitelist)
Set the fields to extract query terms from.void
setWhitelist(java.util.Collection<java.lang.String> whitelist)
Set the fields to extract query terms from.protected void
toString(java.lang.StringBuilder buffer, FieldExpression.StringMode mode)
Writes the string representation of this field expression tobuffer
.static Teaser
valueOf(StringParser parser)
-
Methods inherited from class com.attivio.sdk.search.fields.UnaryFieldExpression
clone, forEachField, getExpression, getFieldName, hasChildren, setExpression
-
Methods inherited from class com.attivio.sdk.search.fields.FieldExpression
apply, copyOf, forEachPhrase, getDefaultName, isConstant, parse, quote, rewrite, rewriteChildren, toString, toString, valueOf
-
-
-
-
Constructor Detail
-
Teaser
public Teaser(java.lang.String fieldName)
-
Teaser
public Teaser(FieldExpression expression)
-
-
Method Detail
-
isConstant
public boolean isConstant()
Returnstrue
if this field expression evaluates to a constant value.- Overrides:
isConstant
in classUnaryFieldExpression
-
getType
public SchemaField.Type getType(Schema schema)
Resolve the type for this expression.- Specified by:
getType
in classFieldExpression
-
getQuery
public Query getQuery()
Get the query to use for highlighting.If null, the
QueryRequest
's highlight query will be used.
-
getQuery
public Query getQuery(Query defaultQuery)
Get the query to use for highlighting.Returns
defaultQuery
if highlighting query is not set.
-
setQuery
public void setQuery(Query value)
Set the query to use for highlightingIf null, the
QueryRequest
's highlight query will be used.
-
setTokenizer
public void setTokenizer(java.lang.String tokenizer)
Set the tokenizer to use for highlighting.
-
getTokenizer
public java.lang.String getTokenizer()
Get the name of the tokenizer to use for highlighting.
-
getHighlightScope
public java.lang.String getHighlightScope()
Get the scope name to annotate phrase matches with.
-
setHighlightScope
public void setHighlightScope(java.lang.String value)
Set the scope name to annotate phrase matches with.
-
getMatchScope
public java.lang.String getMatchScope()
Get the scope name to annotate atomic matches with.
-
setMatchScope
public void setMatchScope(java.lang.String value)
Set the scope name to annotate atomic matches with.
-
getHighlightMode
public HighlightMode getHighlightMode()
Get the mode for annotating scopes.
-
setHighlightMode
public void setHighlightMode(HighlightMode value)
Set the mode for annotating scopes.
-
setFallbackField
public void setFallbackField(java.lang.String field)
Set the fallback field (to use if highlighting yields no text).
-
getFallbackField
public java.lang.String getFallbackField()
Get the fallback field.
-
setFragment
public void setFragment(java.lang.Boolean value)
Set if the teaser should be fragmented.
-
isFragment
public java.lang.Boolean isFragment()
Get if the teaser should be fragmented.
-
setMergeFragments
public void setMergeFragments(java.lang.Boolean value)
Set if fragments should be merged.
-
isMergeFragments
public java.lang.Boolean isMergeFragments()
Get if fragments should be merged.
-
setNumFragments
public void setNumFragments(java.lang.Integer value)
Set the number of framents to generate (if fragmenting).
-
getNumFragments
public java.lang.Integer getNumFragments()
Get the number of framents to generate (if fragmenting).
-
setFragmentSize
public void setFragmentSize(java.lang.Integer value)
Set the size of generated fragments.
-
getFragmentSize
public java.lang.Integer getFragmentSize()
Get the size of generated fragments.
-
getFragmentScope
public java.lang.String getFragmentScope()
Get the name of the scope to use for fragmenting.
-
setFragmentScope
public void setFragmentScope(java.lang.String value)
Set the name of the scope to use for fragmenting.
-
setSeparator
public void setSeparator(java.lang.String value)
Set the markup to insert between generated fragments.
-
getSeparator
public java.lang.String getSeparator()
Get the markup to insert between generated fragments.
-
getWhitelist
public java.lang.String[] getWhitelist()
Get the fields to extract query terms from.
-
setWhitelist
public void setWhitelist(java.lang.String... whitelist)
Set the fields to extract query terms from.
-
setWhitelist
public void setWhitelist(java.util.Collection<java.lang.String> whitelist)
Set the fields to extract query terms from.
-
rewrite
public void rewrite(QueryHandler handler, boolean recursive)
Rewrite any query objects in this FieldExpression usinghandler
.- Overrides:
rewrite
in classUnaryFieldExpression
-
forEachQuery
public FieldExpression forEachQuery(QueryHandler handler)
- Overrides:
forEachQuery
in classFieldExpression
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classUnaryFieldExpression
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classUnaryFieldExpression
-
toString
protected void toString(java.lang.StringBuilder buffer, FieldExpression.StringMode mode)
Writes the string representation of this field expression tobuffer
.- Specified by:
toString
in classFieldExpression
-
clone
public Teaser clone()
- Overrides:
clone
in classUnaryFieldExpression
-
setParameters
protected void setParameters(StringParser reader)
-
valueOf
public static Teaser valueOf(StringParser parser)
-
-