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
null
value.- 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 ScoreMode
DEFAULT_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 void
appendParameters(java.lang.StringBuilder buffer)
boolean
equals(java.lang.Object other)
FieldExpression
forEachPhrase(PhraseHandler handler)
Applieshandler
for eachPhrase
argument.java.lang.String
getFieldName()
Get the field to match against.Phrase
getPhrase()
Get the phrase to use for matching.ScoreMode
getScoreMode()
Get the mode to use for scoring the phrase.SchemaField.Type
getType(Schema schema)
Resolve the type for this expression.boolean
hasChildren()
Returnstrue
if this field expression has any sub FieldExpressions.int
hashCode()
boolean
isConstant()
Returnstrue
if this field expression evaluates to a constant value.void
rewrite(QueryHandler handler, boolean recursive)
Rewrite any query objects in this FieldExpression usinghandler
.void
setFieldName(java.lang.String value)
Set the field to match against.void
setPhrase(Phrase value)
Set the phrase to use for matching.void
setScoreMode(ScoreMode value)
Set the mode to use for scoring the phrase.protected void
toString(java.lang.StringBuilder buffer, FieldExpression.StringMode mode)
Writes the string representation of this field expression tobuffer
.static PhraseScore
valueOf(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:
getType
in 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:
getFieldName
in 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()
Returnstrue
if this field expression has any sub FieldExpressions.- Specified by:
hasChildren
in classFieldExpression
-
isConstant
public boolean isConstant()
Returnstrue
if this field expression evaluates to a constant value.- Specified by:
isConstant
in classFieldExpression
-
forEachPhrase
public FieldExpression forEachPhrase(PhraseHandler handler)
- Overrides:
forEachPhrase
in classFieldExpression
-
rewrite
public void rewrite(QueryHandler handler, boolean recursive)
Rewrite any query objects in this FieldExpression usinghandler
.- Overrides:
rewrite
in classFieldExpression
-
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
-
-