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

                  }

           }

     }

  • 相关阅读:
    iframe
    # ? & 号在url中的的作用
    面向对象和面向过程
    dom
    DOM对象与jquery对象有什么不同
    绑定js
    leetcode — search-for-a-range
    leetcode — search-for-a-range
    leetcode — search-in-rotated-sorted-array
    leetcode — longest-valid-parentheses
  • 原文地址:https://www.cnblogs.com/lexiaofei/p/6652252.html
Copyright © 2011-2022 走看看