Interface SpanNearCondition

Matches spans which are near one another. One can specify slop, the maximum number of intervening unmatched positions, as well as whether matches are required to be in-order.

Example


import * as es from 'es'
let client=es.newClient('axis_esClient')
let spanNear: es.SpanNearCondition = {
clauses: [{
"span_term": { "field": "value1" }
}, {
"span_term": { "field": "value2" }
}],
slop: 12,
in_order: false
}
let querydsl:es.Query={
"span_near":spanNear
}
let cnt = client.updateByQuery("indexName", querydsl, "newScript")
interface SpanNearCondition {
    boost?: number;
    clauses?: "es".Query[];
    in_order?: boolean;
    query_name?: string;
    slop?: number;
}

Properties

boost?: number

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

clauses?: "es".Query[]

clauses: 查询语句数组

in_order?: boolean

In_order:如果为true,则每个子句的跨度必须与子句中的顺序相同,并且必须不重叠。默认为true。

query_name?: string

query_name:筛选器的查询名称,在每次命中搜索match_filters时可以使用该筛选器

slop?: number

slop:中间不匹配位置的最大数量。