Class 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
    • Field Detail

      • DEFAULT_SCORE_MODE

        public static ScoreMode DEFAULT_SCORE_MODE
    • Constructor Detail

      • PhraseScore

        public PhraseScore​(java.lang.String field,
                           Phrase phrase)
      • PhraseScore

        public PhraseScore​(java.lang.String field,
                           Phrase phrase,
                           ScoreMode scoreMode)
    • 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.
      • equals

        public boolean equals​(java.lang.Object other)
      • appendParameters

        protected void appendParameters​(java.lang.StringBuilder buffer)
      • hashCode

        public int hashCode()
      • getFieldName

        public java.lang.String getFieldName()
        Get the field to match against.
        Overrides:
        getFieldName in class FieldExpression
      • 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()
        Returns true if this field expression has any sub FieldExpressions.
        Specified by:
        hasChildren in class FieldExpression
      • isConstant

        public boolean isConstant()
        Returns true if this field expression evaluates to a constant value.
        Specified by:
        isConstant in class FieldExpression
      • rewrite

        public void rewrite​(QueryHandler handler,
                            boolean recursive)
        Rewrite any query objects in this FieldExpression using handler.
        Overrides:
        rewrite in class FieldExpression