FuzzyCondition.java 文件源码

java
阅读 15 收藏 0 点赞 0 评论 0

项目:stratio-cassandra 作者:
/**
 * Returns a new {@link FuzzyCondition}.
 *
 * @param boost          The boost for this query clause. Documents matching this clause will (in addition to the
 *                       normal weightings) have their score multiplied by {@code boost}. If {@code null}, then
 *                       {@link #DEFAULT_BOOST} is used as default.
 * @param field          The field name.
 * @param value          The field fuzzy value.
 * @param maxEdits       Must be >= 0 and <= {@link LevenshteinAutomata#MAXIMUM_SUPPORTED_DISTANCE}.
 * @param prefixLength   Length of common (non-fuzzy) prefix
 * @param maxExpansions  The maximum number of terms to match. If this number is greater than {@link
 *                       BooleanQuery#getMaxClauseCount} when the query is rewritten, then the maxClauseCount will
 *                       be used instead.
 * @param transpositions True if transpositions should be treated as a primitive edit operation. If this is false,
 *                       comparisons will implement the classic Levenshtein algorithm.
 */
@JsonCreator
public FuzzyCondition(@JsonProperty("boost") Float boost,
                      @JsonProperty("field") String field,
                      @JsonProperty("value") String value,
                      @JsonProperty("max_edits") Integer maxEdits,
                      @JsonProperty("prefix_length") Integer prefixLength,
                      @JsonProperty("max_expansions") Integer maxExpansions,
                      @JsonProperty("transpositions") Boolean transpositions) {
    super(boost);

    this.field = field;
    this.value = value;
    this.maxEdits = maxEdits == null ? DEFAULT_MAX_EDITS : maxEdits;
    this.prefixLength = prefixLength == null ? DEFAULT_PREFIX_LENGTH : prefixLength;
    this.maxExpansions = maxExpansions == null ? DEFAULT_MAX_EXPANSIONS : maxExpansions;
    this.transpositions = transpositions == null ? DEFAULT_TRANSPOSITIONS : transpositions;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号