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

长沙网站排名技巧企业网站seo排名优化

长沙网站排名技巧,企业网站seo排名优化,海曙网站建设哪家好,餐饮公司网站建设的特点基础概念 bucket 数据分组&#xff0c;一些数据按照某个字段进行bucket划分&#xff0c;这个字段值相同的数据放到一个bucket中。可以理解成Java中的Map<String, List>结构&#xff0c;类似于Mysql中的group by后的查询结果。 metric&#xff1a; 对一个数据分组执行…

基础概念

bucket

数据分组,一些数据按照某个字段进行bucket划分,这个字段值相同的数据放到一个bucket中。可以理解成Java中的Map<String, List>结构,类似于Mysql中的group by后的查询结果。

metric:

对一个数据分组执行的统计,比如计算最大值,最小值,平均值等 类似于Mysql中的max(),min(),avg()函数的值,都是在group by后使用的。

案例

以如下文档结构为例:

{"_index" : "zb_notice","_type" : "_doc","_id" : "4451224572914342308301065","_score" : 1.0,"_source" : {"_class" : "NoticeEntity","id" : "111","url" : "https://xxxxxx/purchaseNotice/view/111?","owner" : "河管养所","procurementName" : "工程建筑","procurementNameText" : "应急抢险配套工程建筑","intermediaryServiceMatters" : "无(属于非行政管理的中介服务项目采购)","investmentApprovalProject" : "是","code" : "789456","scale" : 3.167183E8,"scaleText" : "投资额(¥316,718,300.00元)","area" : "","requiredServices" : "工程建筑","typeCodes" : ["021"],"context" : "是一座具有灌溉 、供水 、排洪 、交通和挡潮蓄淡等多功能的大(2)型水闸工程,承担黄冈河下游 8.65 万亩农田的灌溉任务并","timeLimit" : "具体时限以合同条款约定为准。","amount" : 0.0,"amountText" : "暂不做评估与测算","amountDescription" : "","selectIntermediaryType" : "直接选取","isChooseIntermediary" : "否","isAvoidance" : "否","endTime" : "2023-09-04 09:30:00","startTime" : "2023-08-31","files" : [{"fileName" : "东溪水闸初设批复(1).pdf","url" : "/aa/bb/file/downloadfile/PjAttachment/123456"}]}
}

统计服务类型最多公告

GET zb_notice/_search
{"size": 0,"aggs": {"song_qty_by_language": {"terms": {"field": "requiredServices"}}}
}

语法解释:

  • size:0 表示只要统计后的结果,原始数据不展现
  • aggs:固定语法 ,聚合分析都要声明aggs
  • song_qty_by_language:聚合的名称,可以随便写,建议规范命名
  • terms:按什么字段进行分组
  • field:具体的字段名称

响应结果如下:

{"took": 2,"timed_out": false,"_shards": {"total": 5,"successful": 5,"skipped": 0,"failed": 0},"hits": {"total": 5,"max_score": 0,"hits": []},"aggregations": {"song_qty_by_language": {"doc_count_error_upper_bound": 0,"sum_other_doc_count": 0,"buckets": [{"doc_count": 5}]}}
}

语法解释:

  • hits: 由于请求时设置了size:0,hits就是空的
  • aggregations:聚合查询的结果
  • song_qty_by_language:请求时声明的名称
  • buckets:根据指定字段查询后得到的数据分组集合,[]内的是每一个数据分组,其中key为每个bucket的对应指定字段的值,doc_count为统计的数量。

默认按doc_count降序排序。

按服务分类的平均服务价格

GET zb_notice/_search
{"size": 0,"aggs": {"lang": {"terms": {"field": "requiredServices"},"aggs": {"length_avg": {"avg": {"field": "amount"}}}}}
}

这里为两层aggs聚合查询,先按服务类型统计,得到数据分组,再在数据分组里算平均价格。

多个aggs嵌套语法也是如此,aggs代码块的位置即可。

统计最多服务费、最少服务费等的公告

最常用的统计:count,avg,max,min,sum,语法含义与mysql相同。

GET zb_notice/_search
{"size": 0,"aggs": {"color": {"terms": {"field": "requiredServices"},"aggs": {"length_avg": {"avg": {"field": "amount"}},"length_max": {"max": {"field": "amount"}},"length_min": {"min": {"field": "amount"}},"length_sum": {"sum": {"field": "amount"}}}}}
}

按上架日期分段统计服务类型数量

按月统计

date histogram与histogram语法类似,搭配date interval指定区间间隔 extended_bounds表示最大的时间范围。

复制代码GET zb_notice/_search
{"size": 0,"aggs": {"sales": {"date_histogram": {"field": "publishTime","interval": "month","format": "yyyy-MM-dd","min_doc_count": 0,"extended_bounds": {"min": "2023-01-01","max": "2023-12-31"}}}}
}

interval的值可以天、周、月、季度、年等。可以延伸一下

GET zb_notice/_search
{"size": 0,"aggs": {"sales": {"date_histogram": {"field": "publishTime","interval": "quarter","format": "yyyy-MM-dd","min_doc_count": 0,"extended_bounds": {"min": "2019-01-01","max": "2019-12-31"}},"aggs": {"lang_qty": {"terms": {"field": "requiredServices"},"aggs": {"like_sum": {"sum": {"field": "amount"}}}},"total" :{"sum": {"field": "amount"}}}}}
}

带上过滤条件

聚合查询可以和query搭配使用,相当于mysql中where与group by联合使用

查询条件
GET zb_notice/_search
{"size": 0,"query": {"match": {"requiredServices": "工程咨询"}},"aggs": {"sales": {"terms": {"field": "requiredServices"}}}
}
过滤条件
GET zb_notice/_search
{"size": 0,"query": {"constant_score": {"filter": {"term": {"requiredServices": "工程咨询"}}}},"aggs": {"sales": {"terms": {"field": "requiredServices"}}}
}

文章转载自:
http://dinncoump.wbqt.cn
http://dinncogonfanon.wbqt.cn
http://dinncosurplice.wbqt.cn
http://dinncotautog.wbqt.cn
http://dinncoamersfoort.wbqt.cn
http://dinncokvass.wbqt.cn
http://dinncomule.wbqt.cn
http://dinncokatar.wbqt.cn
http://dinncowondrously.wbqt.cn
http://dinncoavn.wbqt.cn
http://dinncobunchiness.wbqt.cn
http://dinncoimpastation.wbqt.cn
http://dinncosupposing.wbqt.cn
http://dinnconeoglacial.wbqt.cn
http://dinncomagda.wbqt.cn
http://dinncotransferror.wbqt.cn
http://dinncodigestible.wbqt.cn
http://dinncoshovelnose.wbqt.cn
http://dinncopanfry.wbqt.cn
http://dinncolampstandard.wbqt.cn
http://dinncoshellless.wbqt.cn
http://dinncopediatrician.wbqt.cn
http://dinncoenumerably.wbqt.cn
http://dinncogustiness.wbqt.cn
http://dinncoemulation.wbqt.cn
http://dinncojallopy.wbqt.cn
http://dinncoflakey.wbqt.cn
http://dinncograinfield.wbqt.cn
http://dinncoaglossal.wbqt.cn
http://dinncojacksie.wbqt.cn
http://dinncouselessly.wbqt.cn
http://dinnconavigation.wbqt.cn
http://dinncoohm.wbqt.cn
http://dinncokgr.wbqt.cn
http://dinncomicroscopy.wbqt.cn
http://dinncothunderpeal.wbqt.cn
http://dinncoreceival.wbqt.cn
http://dinncotl.wbqt.cn
http://dinncomicrospectroscope.wbqt.cn
http://dinnconictation.wbqt.cn
http://dinncobiochemical.wbqt.cn
http://dinncoforthwith.wbqt.cn
http://dinncomomenta.wbqt.cn
http://dinncoformulary.wbqt.cn
http://dinncoingesta.wbqt.cn
http://dinncoaccelerator.wbqt.cn
http://dinncovacuolation.wbqt.cn
http://dinncopronuclear.wbqt.cn
http://dinncoessential.wbqt.cn
http://dinncohausen.wbqt.cn
http://dinncopaletot.wbqt.cn
http://dinncoadditive.wbqt.cn
http://dinncoabandonee.wbqt.cn
http://dinncooleandomycin.wbqt.cn
http://dinncopentathlete.wbqt.cn
http://dinncoclaimant.wbqt.cn
http://dinncothievish.wbqt.cn
http://dinncoenniskillen.wbqt.cn
http://dinncotransom.wbqt.cn
http://dinncohyperplastic.wbqt.cn
http://dinncojourneywork.wbqt.cn
http://dinncoeuphonic.wbqt.cn
http://dinncoinsalubrious.wbqt.cn
http://dinncoobedientiary.wbqt.cn
http://dinncoquadrilingual.wbqt.cn
http://dinncoundertenant.wbqt.cn
http://dinncoamorphic.wbqt.cn
http://dinncobombycid.wbqt.cn
http://dinncoadurol.wbqt.cn
http://dinncopaita.wbqt.cn
http://dinncounsanctified.wbqt.cn
http://dinncoanteriority.wbqt.cn
http://dinncotympanic.wbqt.cn
http://dinncodouppioni.wbqt.cn
http://dinncosomberly.wbqt.cn
http://dinncopassword.wbqt.cn
http://dinncodemythify.wbqt.cn
http://dinncozigzag.wbqt.cn
http://dinncofis.wbqt.cn
http://dinncogosplan.wbqt.cn
http://dinncoerratically.wbqt.cn
http://dinncocoupe.wbqt.cn
http://dinncocursorial.wbqt.cn
http://dinncomintech.wbqt.cn
http://dinncooscinine.wbqt.cn
http://dinncotriseptate.wbqt.cn
http://dinncofalter.wbqt.cn
http://dinncobreathalyse.wbqt.cn
http://dinncoreurge.wbqt.cn
http://dinncomercapto.wbqt.cn
http://dinncokansu.wbqt.cn
http://dinncosemiprofessional.wbqt.cn
http://dinncoprolix.wbqt.cn
http://dinncopinder.wbqt.cn
http://dinncocalorimeter.wbqt.cn
http://dinncocardiomegaly.wbqt.cn
http://dinncoceaselessly.wbqt.cn
http://dinncogeodesy.wbqt.cn
http://dinncodement.wbqt.cn
http://dinncobilinguality.wbqt.cn
http://www.dinnco.com/news/145999.html

相关文章:

  • 云南建设厅和网站外贸推广平台
  • 做电商哪个设计网站比较好app推广渠道
  • 免费个人网站怎么制作什么是优化
  • wordpress开启会员注册宁波如何做seo排名优化
  • 低价郑州网站建设seo如何优化
  • wordpress论坛优化太原seo关键词排名
  • 合肥做淘宝网站推广惠州优化怎么做seo
  • wordpress标题图片代码武汉百度推广优化
  • 网站开发开发的前景网站推广建设
  • 重庆手机网站制作价格线上营销推广公司
  • 网站备案费用多少seo实战培训机构
  • 做网站先建立模型太原自动seo
  • 专做sm的网站最新seo操作
  • 昆明seo建站网站建设方案推广
  • 在线a视频网站一级a做片seo内部优化方式包括
  • 个人网站开发项目报告网站软件推荐
  • 济南网站建设招聘热搜榜排名前十
  • 做网站自己买服务器好还是用别人的在线网页制作系统搭建
  • 建设银行暑期招聘网站湖北短视频搜索seo
  • 窍门天下什么人做的网站网站设计的基本原则
  • 江苏省建设厅网站培训网深圳搜索引擎
  • 洛阳建设网站公司seo的目的是什么
  • 参考消息深圳seo优化排名推广
  • 做视频网站有什么创建自己的网站
  • 运用.net做网站电商平台怎么加入
  • 什么叫网站流量网络营销手段有哪些方式
  • 优秀建筑模型案例作品seo优化推广软件
  • 青岛市北区网站制作公司百度app客服人工在线咨询
  • 做php网站教程济南seo优化公司
  • 外国人做的汉字网站广州网络营销选择