zoukankan      html  css  js  c++  java
  • 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
    }
    }
    }

  • 相关阅读:
    Java Web学习笔记---用GET实现搜索引擎
    Docker之docker log详解
    Docker之save、load、export、import命令
    Docker之镜像地址
    GIT使用详解
    Docker之commit制作镜像
    Python之sys.arg[]的用法解释
    python常用内置函数
    VBA精彩代码分享-1
    C#读写EXCEL单元格的问题
  • 原文地址:https://www.cnblogs.com/wzk-0000/p/12059495.html
Copyright © 2011-2022 走看看