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

  • 相关阅读:
    省选D2T2 滚榜
    CF1516E(第一类斯特林数)
    Atcoder ZEP F题
    Atcoder ARC 115 A~D
    Atcoder ARC 117
    「舞蹈链 DLX 」学习笔记
    「FJOI-2021」仰视那片离我远去了的天空。
    「UVA1603」破坏正方形 Square Destroyer
    「网络流」学习笔记
    博客搬家
  • 原文地址:https://www.cnblogs.com/qiu-hua/p/14197806.html
Copyright © 2011-2022 走看看