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 Teaserclone()booleanequals(java.lang.Object other)FieldExpressionforEachQuery(QueryHandler handler)Applieshandlerfor eachQueryargument.java.lang.StringgetFallbackField()Get the fallback field.java.lang.StringgetFragmentScope()Get the name of the scope to use for fragmenting.java.lang.IntegergetFragmentSize()Get the size of generated fragments.HighlightModegetHighlightMode()Get the mode for annotating scopes.java.lang.StringgetHighlightScope()Get the scope name to annotate phrase matches with.java.lang.StringgetMatchScope()Get the scope name to annotate atomic matches with.java.lang.IntegergetNumFragments()Get the number of framents to generate (if fragmenting).QuerygetQuery()Get the query to use for highlighting.QuerygetQuery(Query defaultQuery)Get the query to use for highlighting.java.lang.StringgetSeparator()Get the markup to insert between generated fragments.java.lang.StringgetTokenizer()Get the name of the tokenizer to use for highlighting.SchemaField.TypegetType(Schema schema)Resolve the type for this expression.java.lang.String[]getWhitelist()Get the fields to extract query terms from.inthashCode()booleanisConstant()Returnstrueif this field expression evaluates to a constant value.java.lang.BooleanisFragment()Get if the teaser should be fragmented.java.lang.BooleanisMergeFragments()Get if fragments should be merged.voidrewrite(QueryHandler handler, boolean recursive)Rewrite any query objects in this FieldExpression usinghandler.voidsetFallbackField(java.lang.String field)Set the fallback field (to use if highlighting yields no text).voidsetFragment(java.lang.Boolean value)Set if the teaser should be fragmented.voidsetFragmentScope(java.lang.String value)Set the name of the scope to use for fragmenting.voidsetFragmentSize(java.lang.Integer value)Set the size of generated fragments.voidsetHighlightMode(HighlightMode value)Set the mode for annotating scopes.voidsetHighlightScope(java.lang.String value)Set the scope name to annotate phrase matches with.voidsetMatchScope(java.lang.String value)Set the scope name to annotate atomic matches with.voidsetMergeFragments(java.lang.Boolean value)Set if fragments should be merged.voidsetNumFragments(java.lang.Integer value)Set the number of framents to generate (if fragmenting).protected voidsetParameters(StringParser reader)voidsetQuery(Query value)Set the query to use for highlightingvoidsetSeparator(java.lang.String value)Set the markup to insert between generated fragments.voidsetTokenizer(java.lang.String tokenizer)Set the tokenizer to use for highlighting.voidsetWhitelist(java.lang.String... whitelist)Set the fields to extract query terms from.voidsetWhitelist(java.util.Collection<java.lang.String> whitelist)Set the fields to extract query terms from.protected voidtoString(java.lang.StringBuilder buffer, FieldExpression.StringMode mode)Writes the string representation of this field expression tobuffer.static TeaservalueOf(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()
Returnstrueif this field expression evaluates to a constant value.- Overrides:
isConstantin classUnaryFieldExpression
-
getType
public SchemaField.Type getType(Schema schema)
Resolve the type for this expression.- Specified by:
getTypein 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
defaultQueryif 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:
rewritein classUnaryFieldExpression
-
forEachQuery
public FieldExpression forEachQuery(QueryHandler handler)
- Overrides:
forEachQueryin classFieldExpression
-
hashCode
public int hashCode()
- Overrides:
hashCodein classUnaryFieldExpression
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classUnaryFieldExpression
-
toString
protected void toString(java.lang.StringBuilder buffer, FieldExpression.StringMode mode)Writes the string representation of this field expression tobuffer.- Specified by:
toStringin classFieldExpression
-
clone
public Teaser clone()
- Overrides:
clonein classUnaryFieldExpression
-
setParameters
protected void setParameters(StringParser reader)
-
valueOf
public static Teaser valueOf(StringParser parser)
-
-