栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

es - elasticsearch - aggs - metrics - t-test

es - elasticsearch - aggs - metrics - t-test

世界上并没有完美的程序,但是我们并不因此而沮丧,因为写程序就是一个不断追求完美的过程。

问:t-test有什么特点?
答:

问:t-test如何使用?
答:

DELETE t_test_test;

PUT /t_test_test
{
  "mappings": {
    "properties": {
      "num_1": {"type": "integer"},
      "num_2": {"type": "integer"}
    }
  }
}

POST /t_test_test/_doc/1
{
  "num_1": 3,
  "num_2": 3
}


POST /t_test_test/_doc/2
{
  "num_1": 6,
  "num_2": 3
}


POST /t_test_test/_doc/3
{
  "num_1": 9,
  "num_2": 3
}


GET /t_test_test/_search
{
  "size": 0,
  "aggs": {
    "t_aggs": {
      "t_test": {
        "a": {"field": "num_1"},
        "b": {"field": "num_2"},
        "type": "paired"
      }
    }
  }
}

# 结果
{
  "took" : 1,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 3,
      "relation" : "eq"
    },
    "max_score" : null,
    "hits" : [ ]
  },
  "aggregations" : {
    "t_aggs" : {
      "value" : 0.22540333075851618
    }
  }
}
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/617975.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号