• ES与关系型数据库的通俗比较


    1、在Elasticsearch中,文档归属于一种类型(type),而这些类型存在于索引(index)中,我们可以画一些简单的对比图来类比传统关系型数据库:

    Relational DB -> Databases -> Tables -> Rows -> Columns

    Elasticsearch -> Indices -> Types -> Documents -> Fields

    即:Elasticsearch集群可以包含多个索引(indices)(数据库),每一个索引可以包含多个类型(types)(表),每一个类型包含多个文档(documents)(行),然后每个文档包含多个字段(Fields)(列)。

    例如在kibana中的Dev Tool中查询:

    //查指定userId

    GET /risk_merchant_his/_search
    {"query":{
      "bool" : {
        "must" : [
          {
          "term" : {
            "userId" : {
              "value" : 109530,
              "boost" : 1.0
              }
            }
          }
        ],
        "adjust_pure_negative" : true,
        "boost" : 1.0
        }
      }
    }

    //查全量数据

    GET /risk_order_his/_search
    {"query":{
    "bool" : {
    "must" : [
    {
    "match_all": {

    }
    }

    ],
    "adjust_pure_negative" : true,
    "boost" : 1.0
    }
    }
    }

  • 相关阅读:
    eclipse javaWeb项目如何引入jar包
    Unity3D 批量图片资源导入设置
    WaitForTargetFPS
    自适应分辨率
    UnityException: Texture is not readable
    Unity bundle的制作和使用
    Unity3D之Assetbundle
    Unity使用外部版本控制SVN
    AssetBundle机制相关资料收集
    Assetbundle的杂七杂八
  • 原文地址:https://www.cnblogs.com/wzk-0000/p/12059495.html
Copyright © 2020-2023  润新知