zoukankan      html  css  js  c++  java
  • 复合查询

    复合查询

    • 将多个基本查询组合成单一查询的查询

      GET /lib2/user/_search
      {
         "query":{
             "bool":{
                 "must":{
                     "match":{"interests":"唱歌"}
                },
                 "must_not":{
                     "match":{"interests":"旅游"}
                },
                 "should":[
                    {"match":{"adress":"bei jing"}}
                ],
                 "filter":{
                     "range":{"birthday":{"gte":"1996-01-01"}}
                }
            }
        }
      }
    • constant_score查询:它将一个不变的常量评分应用于所有匹配的文档。它被经常用于你需要执行一个filter而没有其他查询(例如,评分查询)的情况下。

      GET /lib2/user/_search
      {
       "query": {
         "constant_score": {
           "filter": {
             "term": {
               "interests": "唱歌"
            }
          }
        }
      }
      }
  • 相关阅读:
    Web的攻击技术
    基于HTTP的功能追加协议
    确认访问用户身份的认证
    基本数据结构的模拟
    BFS与DFS
    KMP算法
    Trie字典树
    C++的结构体使用
    C++入门(命名空间)
    算法:C++入门
  • 原文地址:https://www.cnblogs.com/zxbdboke/p/10465793.html
Copyright © 2011-2022 走看看