Interface FuzzyCondition

返回包含与搜索词相似的术语的文档

Example


import * as es from 'es'
let client=es.newClient('axis_esClient')
let fuzzy: es.FuzzyCondition = {
"user.id": {
"value": "ki"
}
}
let querydsl:es.Query={
"fuzzy":fuzzy
}
let cnt = client.updateByQuery("indexName", querydsl, "newScript")
interface FuzzyCondition {
    [name: string]: {
        boost?: number;
        fuzziness?: any;
        max_expansions?: number;
        prefix_length?: number;
        rewrite?: string;
        transpositions?: boolean;
        value: any;
    };
}

Indexable

[name: string]: {
    boost?: number;
    fuzziness?: any;
    max_expansions?: number;
    prefix_length?: number;
    rewrite?: string;
    transpositions?: boolean;
    value: any;
}

name:希望查询的字段名

  • Optional boost?: number

    boost:浮点数,用作与筛选器查询匹配的每个文档的常量相关性分数。

  • Optional fuzziness?: any

    fuzziness:允许匹配的最大编辑距离。

  • Optional max_expansions?: number

    max_expansions:查询将扩展到的最大术语数。

  • Optional prefix_length?: number

    prefix_length:为模糊匹配保留不变的起始字符数。

  • Optional rewrite?: string

    rewrite:用于重写查询的方法。

  • Optional transpositions?: boolean

    transpositions:模糊匹配的编辑是否包括两个相邻字符的转置

  • value: any

    value:希望在提供的字段中找到的术语.