public class Teaser extends UnaryFieldExpression
FieldExpression.StringMode
expression
alias, EMPTY_ARRAY
Constructor and Description |
---|
Teaser(FieldExpression expression,
String alias) |
Teaser(String fieldName) |
Teaser(String fieldName,
String alias) |
Modifier and Type | Method and Description |
---|---|
Teaser |
clone() |
String |
getFallbackField()
Get the fallback field.
|
String |
getFragmentScope()
Get the name of the scope to use for fragmenting.
|
Integer |
getFragmentSize()
Get the size of generated fragments.
|
HighlightMode |
getHighlightMode()
Get the mode for annotating scopes.
|
String |
getHighlightScope()
Get the scope name to annotate phrase matches with.
|
String |
getMatchScope()
Get the scope name to annotate atomic matches with.
|
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.
|
String |
getSeparator()
Get the markup to insert between generated fragments.
|
String |
getTokenizer()
Get the name of the tokenizer to use for highlighting.
|
SchemaField.Type |
getType(Schema schema)
Resolve the type for this expression.
|
String[] |
getWhitelist()
Get the fields to extract query terms from.
|
int |
hashCode() |
boolean |
isConstant()
Returns
true if this field expression evaluates to a constant value. |
Boolean |
isFragment()
Get if the teaser should be fragmented.
|
Boolean |
isMergeFragments()
Get if fragments should be merged.
|
protected boolean |
parametersEqual(FieldExpression other)
Returns
true if other 's parameters are the same as this . |
void |
rewrite(QueryHandler handler,
boolean recursive)
Rewrite any query objects in this FieldExpression using
handler . |
void |
setFallbackField(String field)
Set the fallback field (to use if highlighting yields no text).
|
void |
setFragment(Boolean value)
Set if the teaser should be fragmented.
|
void |
setFragmentScope(String value)
Set the name of the scope to use for fragmenting.
|
void |
setFragmentSize(Integer value)
Set the size of generated fragments.
|
void |
setHighlightMode(HighlightMode value)
Set the mode for annotating scopes.
|
void |
setHighlightScope(String value)
Set the scope name to annotate phrase matches with.
|
void |
setMatchScope(String value)
Set the scope name to annotate atomic matches with.
|
void |
setMergeFragments(Boolean value)
Set if fragments should be merged.
|
void |
setNumFragments(Integer value)
Set the number of framents to generate (if fragmenting).
|
void |
setQuery(Query value)
Set the query to use for highlighting
|
void |
setSeparator(String value)
Set the markup to insert between generated fragments.
|
void |
setTokenizer(String tokenizer)
Set the tokenizer to use for highlighting.
|
void |
setWhitelist(Collection<String> whitelist)
Set the fields to extract query terms from.
|
void |
setWhitelist(String... whitelist)
Set the fields to extract query terms from.
|
protected void |
toString(StringBuilder buffer,
FieldExpression.StringMode mode)
Writes the string representation of this field expression to
buffer . |
clone, equalsIgnoreAlias, getExpression, getFieldName, hasChildren, rewriteChildren, setExpression
as, containsAlias, copyOf, equals, equalsIgnoreAlias, getAlias, getDefaultAlias, handleFieldExpression, isConstant, quote, rewrite, setAlias, toString, toString
public Teaser(String fieldName)
public Teaser(FieldExpression expression, String alias)
public boolean isConstant()
true
if this field expression evaluates to a constant value.isConstant
in class UnaryFieldExpression
public SchemaField.Type getType(Schema schema)
getType
in class FieldExpression
public Query getQuery()
If null, the QueryRequest
's highlight query will be used.
public Query getQuery(Query defaultQuery)
Returns defaultQuery
if highlighting query is not set.
public void setQuery(Query value)
If null, the QueryRequest
's highlight query will be used.
public void setTokenizer(String tokenizer)
public String getTokenizer()
public String getHighlightScope()
public void setHighlightScope(String value)
public String getMatchScope()
public void setMatchScope(String value)
public HighlightMode getHighlightMode()
public void setHighlightMode(HighlightMode value)
public void setFallbackField(String field)
public String getFallbackField()
public void setFragment(Boolean value)
public Boolean isFragment()
public void setMergeFragments(Boolean value)
public Boolean isMergeFragments()
public void setNumFragments(Integer value)
public Integer getNumFragments()
public void setFragmentSize(Integer value)
public Integer getFragmentSize()
public String getFragmentScope()
public void setFragmentScope(String value)
public void setSeparator(String value)
public String getSeparator()
public String[] getWhitelist()
public void setWhitelist(String... whitelist)
public void setWhitelist(Collection<String> whitelist)
public void rewrite(QueryHandler handler, boolean recursive)
handler
.rewrite
in class UnaryFieldExpression
public int hashCode()
hashCode
in class UnaryFieldExpression
protected boolean parametersEqual(FieldExpression other)
true
if other
's parameters are the same as this
.parametersEqual
in class UnaryFieldExpression
protected void toString(StringBuilder buffer, FieldExpression.StringMode mode)
buffer
.
NOTE: the alias will not be written to buffer by this function.
toString
in class FieldExpression
public Teaser clone()
clone
in class UnaryFieldExpression
Copyright © 2018 Attivio, Inc. All Rights Reserved.
PATENT NOTICE: Attivio, Inc. Software Related Patents. With respect to the Attivio software product(s) being used, the following patents apply: Querying Joined Data Within A Search Engine Index: United States Patent No.(s): 8,073,840. Ordered Processing of Groups of Messages: U.S. Patent No.(s) 8,495,656. Signal processing approach to sentiment analysis for entities in documents: U.S. Patent No.(s) 8,725,494. Other U.S. and International Patents Pending.