Package com.attivio.sdk.search.fields
Class PhraseScore
- java.lang.Object
-
- com.attivio.sdk.search.fields.FieldExpression
-
- com.attivio.sdk.search.fields.PhraseScore
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public final class PhraseScore extends FieldExpression
FieldExpression that computes the score for a phrase match for each document.Documents that do not match the phrase query will receive a
nullvalue.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.attivio.sdk.search.fields.FieldExpression
FieldExpression.StringMode
-
-
Field Summary
Fields Modifier and Type Field Description static ScoreModeDEFAULT_SCORE_MODE-
Fields inherited from class com.attivio.sdk.search.fields.FieldExpression
EMPTY_ARRAY
-
-
Constructor Summary
Constructors Constructor Description PhraseScore(java.lang.String field, Phrase phrase)PhraseScore(java.lang.String field, Phrase phrase, ScoreMode scoreMode)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappendParameters(java.lang.StringBuilder buffer)booleanequals(java.lang.Object other)FieldExpressionforEachPhrase(PhraseHandler handler)Applieshandlerfor eachPhraseargument.java.lang.StringgetFieldName()Get the field to match against.PhrasegetPhrase()Get the phrase to use for matching.ScoreModegetScoreMode()Get the mode to use for scoring the phrase.SchemaField.TypegetType(Schema schema)Resolve the type for this expression.booleanhasChildren()Returnstrueif this field expression has any sub FieldExpressions.inthashCode()booleanisConstant()Returnstrueif this field expression evaluates to a constant value.voidrewrite(QueryHandler handler, boolean recursive)Rewrite any query objects in this FieldExpression usinghandler.voidsetFieldName(java.lang.String value)Set the field to match against.voidsetPhrase(Phrase value)Set the phrase to use for matching.voidsetScoreMode(ScoreMode value)Set the mode to use for scoring the phrase.protected voidtoString(java.lang.StringBuilder buffer, FieldExpression.StringMode mode)Writes the string representation of this field expression tobuffer.static PhraseScorevalueOf(StringParser reader)-
Methods inherited from class com.attivio.sdk.search.fields.FieldExpression
apply, clone, copyOf, forEachField, forEachQuery, getDefaultName, isConstant, parse, quote, rewrite, rewriteChildren, toString, toString, valueOf
-
-
-
-
Field Detail
-
DEFAULT_SCORE_MODE
public static ScoreMode DEFAULT_SCORE_MODE
-
-
Method Detail
-
getScoreMode
public ScoreMode getScoreMode()
Get the mode to use for scoring the phrase.
-
setScoreMode
public void setScoreMode(ScoreMode value)
Set the mode to use for scoring the phrase.
-
getType
public SchemaField.Type getType(Schema schema)
Resolve the type for this expression.- Specified by:
getTypein classFieldExpression
-
equals
public boolean equals(java.lang.Object other)
-
appendParameters
protected void appendParameters(java.lang.StringBuilder buffer)
-
hashCode
public int hashCode()
-
valueOf
public static PhraseScore valueOf(StringParser reader)
-
getFieldName
public java.lang.String getFieldName()
Get the field to match against.- Overrides:
getFieldNamein classFieldExpression
-
setFieldName
public void setFieldName(java.lang.String value)
Set the field to match against.
-
getPhrase
public Phrase getPhrase()
Get the phrase to use for matching.
-
setPhrase
public void setPhrase(Phrase value)
Set the phrase to use for matching.
-
hasChildren
public boolean hasChildren()
Returnstrueif this field expression has any sub FieldExpressions.- Specified by:
hasChildrenin classFieldExpression
-
isConstant
public boolean isConstant()
Returnstrueif this field expression evaluates to a constant value.- Specified by:
isConstantin classFieldExpression
-
forEachPhrase
public FieldExpression forEachPhrase(PhraseHandler handler)
- Overrides:
forEachPhrasein classFieldExpression
-
rewrite
public void rewrite(QueryHandler handler, boolean recursive)
Rewrite any query objects in this FieldExpression usinghandler.- Overrides:
rewritein classFieldExpression
-
toString
protected void toString(java.lang.StringBuilder buffer, FieldExpression.StringMode mode)Writes the string representation of this field expression tobuffer.- Specified by:
toStringin classFieldExpression
-
-