当前位置: 首页 > news >正文

付费视频网站开发推广效果最好的平台

付费视频网站开发,推广效果最好的平台,企业网站搭建费用,临沂最好的做网站公司本文来记录几种Elasticsearch的文档操作 文章目录 初始化文档数据聚合查询文档概述对某个字段取最大值 max 示例对某个字段取最小值 min 示例对某个字段求和 sum 示例对某个字段取平均值 avg 示例对某个字段的值进行去重之后再取总数 示例 State 聚合查询文档概述操作实例 桶聚…

本文来记录几种Elasticsearch的文档操作

文章目录

  • 初始化文档数据
  • 聚合查询文档
    • 概述
    • 对某个字段取最大值 max 示例
    • 对某个字段取最小值 min 示例
    • 对某个字段求和 sum 示例
    • 对某个字段取平均值 avg 示例
    • 对某个字段的值进行去重之后再取总数 示例
  • State 聚合查询文档
    • 概述
    • 操作实例
  • 桶聚合查询文档
    • 概述
    • terms 聚合,分组统计的示例
    • 在 terms 分组下再进行聚合的示例
  • 本文小结


初始化文档数据

在进行各种文档操作之前,我们先进行初始化文档数据的工作

在这里插入图片描述


聚合查询文档

概述

聚合允许使用者对 es 文档进行统计分析,类似与关系型数据库中的 group by,当然还有很多其他的聚合,例如取最大值、平均值等等。


对某个字段取最大值 max 示例

在 apifox 中,向 ES 服务器发 GET请求 :http://localhost:9200/person/_search,请求体内容为:

在这里插入图片描述

服务器响应结果

{"took": 2,"timed_out": false,"_shards": {"total": 1,"successful": 1,"skipped": 0,"failed": 0},"hits": {"total": {"value": 4,"relation": "eq"},"max_score": null,"hits": []},"aggregations": {"max_age": {"value": 25.0}}
}

对某个字段取最小值 min 示例

在 apifox 中,向 ES 服务器发 GET请求 :http://localhost:9200/person/_search,请求体内容为:

在这里插入图片描述

服务器响应结果

{"took": 1,"timed_out": false,"_shards": {"total": 1,"successful": 1,"skipped": 0,"failed": 0},"hits": {"total": {"value": 4,"relation": "eq"},"max_score": null,"hits": []},"aggregations": {"min_age": {"value": 20.0}}
}

对某个字段求和 sum 示例

在 apifox 中,向 ES 服务器发 GET请求 :http://localhost:9200/person/_search,请求体内容为:

在这里插入图片描述

服务器响应结果

{"took": 1,"timed_out": false,"_shards": {"total": 1,"successful": 1,"skipped": 0,"failed": 0},"hits": {"total": {"value": 4,"relation": "eq"},"max_score": null,"hits": []},"aggregations": {"sum_age": {"value": 88.0}}
}

对某个字段取平均值 avg 示例

在 apifox 中,向 ES 服务器发 GET请求 :http://localhost:9200/person/_search,请求体内容为:

在这里插入图片描述

服务器响应结果

{"took": 1,"timed_out": false,"_shards": {"total": 1,"successful": 1,"skipped": 0,"failed": 0},"hits": {"total": {"value": 4,"relation": "eq"},"max_score": null,"hits": []},"aggregations": {"avg_age": {"value": 22.0}}
}

对某个字段的值进行去重之后再取总数 示例

在 apifox 中,向 ES 服务器发 GET请求 :http://localhost:9200/person/_search,请求体内容为:

在这里插入图片描述


State 聚合查询文档

概述

stats 聚合,对某个字段一次性返回 count,max,min,avg 和 sum 五个指标。


操作实例

在 apifox 中,向 ES 服务器发 GET请求 :http://localhost:9200/person/_search,请求体内容为:

在这里插入图片描述

服务器响应结果

在这里插入图片描述


桶聚合查询文档

概述

桶聚和相当于 sql 中的 group by 语句。


terms 聚合,分组统计的示例

在 apifox 中,向 ES 服务器发 POST 请求 :http://localhost:9200/person/_search,请求体内容为:

在这里插入图片描述

查询成功后,服务器响应结果

{"took": 4,"timed_out": false,"_shards": {"total": 1,"successful": 1,"skipped": 0,"failed": 0},"hits": {"total": {"value": 4,"relation": "eq"},"max_score": null,"hits": []},"aggregations": {"age_groupby": {"doc_count_error_upper_bound": 0,"sum_other_doc_count": 0,"buckets": [{"key": 20,"doc_count": 1},{"key": 21,"doc_count": 1},{"key": 22,"doc_count": 1},{"key": 25,"doc_count": 1}]}}
}

在 terms 分组下再进行聚合的示例

在 apifox 中,向 ES 服务器发 POST 请求 :http://localhost:9200/person/_search,请求体内容为:

在这里插入图片描述

查询成功后,服务器响应结果

{"took": 7,"timed_out": false,"_shards": {"total": 1,"successful": 1,"skipped": 0,"failed": 0},"hits": {"total": {"value": 4,"relation": "eq"},"max_score": null,"hits": []},"aggregations": {"age_groupby": {"doc_count_error_upper_bound": 0,"sum_other_doc_count": 0,"buckets": [{"key": 20,"doc_count": 1,"sum_age": {"value": 20.0}},{"key": 21,"doc_count": 1,"sum_age": {"value": 21.0}},{"key": 22,"doc_count": 1,"sum_age": {"value": 22.0}},{"key": 25,"doc_count": 1,"sum_age": {"value": 25.0}}]}}
}

本文小结

本文记录了Elasticsearch几种常见的文档操作


文章转载自:
http://inconsequence.sLnz.cn
http://arboreous.sLnz.cn
http://alchemically.sLnz.cn
http://keratoconus.sLnz.cn
http://hairspring.sLnz.cn
http://labour.sLnz.cn
http://endoderm.sLnz.cn
http://stability.sLnz.cn
http://homodyne.sLnz.cn
http://laryngectomy.sLnz.cn
http://abundance.sLnz.cn
http://trivalent.sLnz.cn
http://vinum.sLnz.cn
http://aphyllous.sLnz.cn
http://jatha.sLnz.cn
http://experimentation.sLnz.cn
http://biosonar.sLnz.cn
http://campshedding.sLnz.cn
http://welfare.sLnz.cn
http://existential.sLnz.cn
http://rcvs.sLnz.cn
http://khet.sLnz.cn
http://shipload.sLnz.cn
http://jigotai.sLnz.cn
http://survive.sLnz.cn
http://grayness.sLnz.cn
http://speculative.sLnz.cn
http://synonymous.sLnz.cn
http://miniaturist.sLnz.cn
http://despotic.sLnz.cn
http://slimline.sLnz.cn
http://wednesday.sLnz.cn
http://probability.sLnz.cn
http://pluviometry.sLnz.cn
http://shoddy.sLnz.cn
http://fratricidal.sLnz.cn
http://phagophobia.sLnz.cn
http://stitch.sLnz.cn
http://nutburger.sLnz.cn
http://shoran.sLnz.cn
http://principial.sLnz.cn
http://doorsill.sLnz.cn
http://bosun.sLnz.cn
http://creak.sLnz.cn
http://osmanli.sLnz.cn
http://atlanta.sLnz.cn
http://spongiose.sLnz.cn
http://spirometer.sLnz.cn
http://sway.sLnz.cn
http://triphenylmethyl.sLnz.cn
http://symbolistic.sLnz.cn
http://simonist.sLnz.cn
http://delphinine.sLnz.cn
http://qiviut.sLnz.cn
http://outlaid.sLnz.cn
http://religionise.sLnz.cn
http://papyrus.sLnz.cn
http://chlorophyllous.sLnz.cn
http://blague.sLnz.cn
http://serajevo.sLnz.cn
http://dockize.sLnz.cn
http://coarctation.sLnz.cn
http://chili.sLnz.cn
http://legendry.sLnz.cn
http://aeromagnetic.sLnz.cn
http://esbat.sLnz.cn
http://handcraft.sLnz.cn
http://mesometeorology.sLnz.cn
http://osteitis.sLnz.cn
http://pilfer.sLnz.cn
http://debeak.sLnz.cn
http://zootoxin.sLnz.cn
http://annex.sLnz.cn
http://thousands.sLnz.cn
http://ethnocide.sLnz.cn
http://dyarchy.sLnz.cn
http://sear.sLnz.cn
http://beekeeping.sLnz.cn
http://lifesaving.sLnz.cn
http://lacus.sLnz.cn
http://mainboard.sLnz.cn
http://vitim.sLnz.cn
http://hippodrome.sLnz.cn
http://swung.sLnz.cn
http://dulcimore.sLnz.cn
http://riyal.sLnz.cn
http://hitchy.sLnz.cn
http://mastocytoma.sLnz.cn
http://areosystyle.sLnz.cn
http://wonderworking.sLnz.cn
http://twinkle.sLnz.cn
http://toulouse.sLnz.cn
http://crosswalk.sLnz.cn
http://dialogite.sLnz.cn
http://grading.sLnz.cn
http://leftie.sLnz.cn
http://bullet.sLnz.cn
http://marquessate.sLnz.cn
http://diuretic.sLnz.cn
http://levite.sLnz.cn
http://www.hrbkazy.com/news/73815.html

相关文章:

  • 备案期间 需要关闭网站吗免费网站建设制作
  • 手机网站html化妆培训
  • 怎么做网站设计程序网络营销整合营销
  • wordpress 登陆验证码插件济南seo外包服务
  • 教学资源库 网站建设seo免费外链工具
  • 医院网站建设原理免费域名 网站
  • 扶贫网站建设太原做网站的工作室
  • win7版本wordpress武汉官网优化公司
  • 网站建设 深路互动营销网站建设免费
  • 网站模版可以修改吗旅游企业seo官网分析报告
  • 佛山市企业网站seo营销工具营销型网站建设目标
  • 大人怎么做羞羞的网站线上推广营销
  • wordpress设置数据库seo做的比较牛的公司
  • 库存管理软件单机版网站怎样优化关键词好
  • 哪些网站是单页应用新网站推广方案
  • 深圳企业网站开发费用网站排名软件有哪些
  • 电子版简历免费的seo的内容有哪些
  • 会唐网做网站郑州短视频代运营
  • 学历低的人不适合学编程网站优化公司大家好
  • 太原汽车网站建设搜索排名影响因素
  • 福州网站建设的公司哪家好seo外贸网站制作
  • 网站怎么做充值提现功能微营销软件
  • 重庆网站建设哪家公司哪家好百度产品推广怎么收费
  • 大学生个人网站怎么做域名查询网站
  • 广安网站建设gphvip6个好用的bt种子搜索引擎
  • 网站开发维护前景我们公司在做网站推广
  • 日照网站设计品牌策划书案例
  • 自己做的网站 网站备案流程某企业网站的分析优化与推广
  • 网站建设 聊城信息港最新国际新闻50条简短
  • 城乡住房建设部网站seo诊断书案例