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

  • 相关阅读:
    混合使用UITabBarController和UINavigationController
    基本组件的使用——UITabBarController
    基本组件的使用——UINavigationController
    ios应用程序结构
    让我想起了以前
    如何利用新浪博客做外链1
    如何利用新浪博客做外链
    网站优化之如何更新发布文章
    无线淘宝有600多项加权项
    用代理服务器直接注册小号刷单
  • 原文地址:https://www.cnblogs.com/qiu-hua/p/14197806.html
Copyright © 2011-2022 走看看