Query SQL - 复合查询

作者: animagus | 来源:发表于2019-08-13 19:07 被阅读0次

    混合查询

    Compound queries wrap other compound or leaf queries, either to combine their results and scores, to change their behaviour, or to switch from query to filter context.

    (不太懂)符合查询包裹其他符合查询或叶查询, 同时结合子查询的结果和程度, 这样可以改变子查询的行为或从query切换到filter.

    符合查询包含以下几个:


    布尔查询

    bool query

    布尔查询包括must, should, must_not和filter字句. must和should运行在query上下文, must_not和filter运行在filter上下文


    boosting查询

    boosting query

    Return documents which match a positive query, but reduce the score of documents which also match a negative query.

    返回匹配积极查询条件的文档, 减小匹配消极查询条件的文档范围.


    constant_score query doc

    A query which wraps another query, but executes it in filter context. All matching documents are given the same “constant” _score.

    包含其他子查询的query, 但是在filter上下文中执行. 所有匹配的文档都被赋予相同的“constant” _score


    dis_max query doc

    A query which accepts multiple queries, and returns any documents which match any of the query clauses. While the bool query combines the scores from all matching queries, the dis_max query uses the score of the single best- matching query clause.

    接受多查询的query, 返回尽可能多的匹配任一子查询的文档. (没看懂)While the bool query combines the scores from all matching queries, the dis_max query uses the score of the single best- matching query clause.


    function_score query doc

    Modify the scores returned by the main query with functions to take into account factors like popularity, recency, distance, or custom algorithms implemented with scripting.

    (没看懂)修改主查询返回的scope, 考虑到类似于(欢迎程度, 时间最近, 距离相关或使用scripting实现的自定义算法)的解释因子

    相关文章

      网友评论

        本文标题:Query SQL - 复合查询

        本文链接:https://www.haomeiwen.com/subject/dttijctx.html