zoukankan      html  css  js  c++  java
  • ES基础(四十)聚合分析的原理及精准度问题

     

     

     

     

     

     

     

    课程demo

    DELETE my_flights
    PUT my_flights
    {
      "settings": {
        "number_of_shards": 20
      },
      "mappings" : {
          "properties" : {
            "AvgTicketPrice" : {
              "type" : "float"
            },
            "Cancelled" : {
              "type" : "boolean"
            },
            "Carrier" : {
              "type" : "keyword"
            },
            "Dest" : {
              "type" : "keyword"
            },
            "DestAirportID" : {
              "type" : "keyword"
            },
            "DestCityName" : {
              "type" : "keyword"
            },
            "DestCountry" : {
              "type" : "keyword"
            },
            "DestLocation" : {
              "type" : "geo_point"
            },
            "DestRegion" : {
              "type" : "keyword"
            },
            "DestWeather" : {
              "type" : "keyword"
            },
            "DistanceKilometers" : {
              "type" : "float"
            },
            "DistanceMiles" : {
              "type" : "float"
            },
            "FlightDelay" : {
              "type" : "boolean"
            },
            "FlightDelayMin" : {
              "type" : "integer"
            },
            "FlightDelayType" : {
              "type" : "keyword"
            },
            "FlightNum" : {
              "type" : "keyword"
            },
            "FlightTimeHour" : {
              "type" : "keyword"
            },
            "FlightTimeMin" : {
              "type" : "float"
            },
            "Origin" : {
              "type" : "keyword"
            },
            "OriginAirportID" : {
              "type" : "keyword"
            },
            "OriginCityName" : {
              "type" : "keyword"
            },
            "OriginCountry" : {
              "type" : "keyword"
            },
            "OriginLocation" : {
              "type" : "geo_point"
            },
            "OriginRegion" : {
              "type" : "keyword"
            },
            "OriginWeather" : {
              "type" : "keyword"
            },
            "dayOfWeek" : {
              "type" : "integer"
            },
            "timestamp" : {
              "type" : "date"
            }
          }
        }
    }
    
    
    POST _reindex
    {
      "source": {
        "index": "kibana_sample_data_flights"
      },
      "dest": {
        "index": "my_flights"
      }
    }
    
    GET kibana_sample_data_flights/_count
    GET my_flights/_count
    
    get kibana_sample_data_flights/_search
    
    
    GET kibana_sample_data_flights/_search
    {
      "size": 0,
      "aggs": {
        "weather": {
          "terms": {
            "field":"OriginWeather",
            "size":5,
            "show_term_doc_count_error":true
          }
        }
      }
    }
    
    
    GET my_flights/_search
    {
      "size": 0,
      "aggs": {
        "weather": {
          "terms": {
            "field":"OriginWeather",
            "size":1,
            "shard_size":1,
            "show_term_doc_count_error":true
          }
        }
      }
    }

    本文来自博客园,作者:秋华,转载请注明原文链接:https://www.cnblogs.com/qiu-hua/p/14197806.html

  • 相关阅读:
    创建型设计模式-原型模式(单例) MemberwiseClone()
    Oracle 查看没有释放的链接 和删除,相关sql
    win10 安装 SQL Developer 工具
    修改nuget包默认存放路径 win10
    使用端口查询
    未能加载文件或程序集“Newtonsoft.Json, Version=12.0.0.0,
    微信错误码
    sqlserver 时间转换记录
    Homebrew 使用指南
    在Mac检查安装的.net core 版本
  • 原文地址:https://www.cnblogs.com/qiu-hua/p/14197806.html
Copyright © 2011-2022 走看看