Interface MoreLikeThisCondition

提供like查询。

Example


import * as es from 'es'
let client=es.newClient('axis_esClient')
let moreLikeThis: es.MoreLikeThisCondition = {
fields: ["title", "description"],
like: "once upon a time",
min_term_freq: 1,
max_query_terms: 12
}
let querydsl:es.Query={
"more_like_this":moreLikeThis
}
let cnt = client.updateByQuery("indexName", querydsl, "newScript")
interface MoreLikeThisCondition {
    analyzer?: string;
    boost?: number;
    boost_terms?: number;
    fail_on_unsupported_field?: boolean;
    fields?: string[];
    include?: boolean;
    like?: string;
    max_doc_freq?: number;
    max_query_terms?: number;
    max_word_length?: number;
    min_doc_freq?: number;
    min_term_freq?: number;
    min_word_length?: number;
    minimum_should_match?: string;
    stop_words?: string[];
    unlike?: string;
}

Properties

analyzer?: string

analyzer:用于分析自由格式文本的分析器。

boost?: number

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

boost_terms?: number

boost_terms:所形成的查询中的每个术语都可以通过其 tf-idf 分数进一步提升。

fail_on_unsupported_field?: boolean

fail_on_unsupported_field:控制如果任何指定字段不属于受支持的类型(text或keyword),查询是否应失败

fields?: string[]

fields:查询的字段数组

include?: boolean

include: 指定输入文档是否也应包含在返回的搜索结果中。

like?: string
max_doc_freq?: number

max_doc_freq:最大文档频率,高于该频率的术语将从输入文档中被忽略。

max_query_terms?: number

max_query_terms: 将选择的查询词的最大数量。

max_word_length?: number

max_word_length:最大字长,超过该长度的术语将被忽略。

min_doc_freq?: number

min_doc_freq:最小文档频率,低于该频率的术语将从输入文档中被忽略。

min_term_freq?: number

min_term_freq:最小术语频率,低于该频率的术语将从输入文档中被忽略。

min_word_length?: number

min_word_length:最小字长,低于该长度的术语将被忽略。

minimum_should_match?: string

minimum_should_match:形成析取查询后,此参数控制必须匹配的术语数量。

stop_words?: string[]

stop_words:停用词数组。该集合中的任何单词都被视为“无趣”并被忽略。

unlike?: string