zoukankan      html  css  js  c++  java
  • ELK学习总结(3-3)elk的组合查询

    1、bool 查询:

         must: 必须

         should:  可以满足,也可以不满足。

         must_not: 

         minimum_should_match: 至少要x个匹配才算匹配成功

         disable_coord: 开启和关闭得分计算

     

    2、boosting 查询封装两个查询,降低其中一个返回的分值

          positive:分值不变

          negative:降低分值

          negative_boost:设置要降低的分值

    GET /_search

    {

        "query":{

              "boosting":{

                    "positive":{

                          "match":{

                                "text":"apple"

                          } 

                    },

                    "negative":{

                          "match":{

                                "text":"fruit pie tart red sweet"

                          },

                          "negative_boost":0.5

                    }

               }   

        }

    }     

    3、constant_score 查询:查询结果保持一个恒定的分值

    GET /library/books/_search

    {

         "query":{

                constant_score:{

                     "query":{

                           "term":{

                                "title":"elasticsearch"

                           }

                     }

                }

         }

    4、indicies 查询:在多个索引上进行查询

         no_match_query

    GET /_search

    {

           "query":{

                  "indices":["library","banks"],

                  "query" {

                        "term":{

                               "title":"elasticsearch"

                        }

                  }

           },

           "no_match_query":{

                  "term":{

                        "price":55

                  }

           }

     }

  • 相关阅读:
    windows7安装django并创建第一个应用
    windows7下安装python环境和django
    js中caller和callee属性详解
    分享一个Python脚本--统计redis key类型数据大小分布
    你真的懂git 吗
    如何禁止打印页面
    ZooKeeper入门实战教程(一)-介绍与核心概念
    【shell】shell中各种括号的作用()、(())、[]、[[]]、{}
    Web Components 入门实例教程
    npx 使用教程
  • 原文地址:https://www.cnblogs.com/lexiaofei/p/6652252.html
Copyright © 2011-2022 走看看