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

wordpress兼容手机吗北京网站优化公司哪家好

wordpress兼容手机吗,北京网站优化公司哪家好,做网站价格和配置,wordpress 繁体需求整理: geohash 7网格存储工作热度和学习热度数值,支持随机区域多个范围的热度聚合; 创建索引结构 索引文档需要包含 Geohash 网格、工作热度和学习热度等字段。可以在 Elasticsearch 中定义一个索引,确保 location 字段的类…

需求整理:

geohash 7网格存储工作热度和学习热度数值,支持随机区域多个范围的热度聚合;

创建索引结构

索引文档需要包含 Geohash 网格、工作热度和学习热度等字段。可以在 Elasticsearch 中定义一个索引,确保 location 字段的类型是 geo_point,用于支持地理空间查询。

PUT /geohash_index
{"mappings": {"properties": {"geohash": {"type": "keyword"},"location": {"type": "geo_point"},"work_heat": {"type": "integer"},"study_heat": {"type": "integer"}}}
}

插入数据

POST /geohash_index/_doc/1
{"geohash": "wx4g0f0","location": {"lat": 39.9042,"lon": 116.4074},"work_heat": 100,"study_heat": 50
}

聚合查询

使用 Elasticsearch 的地理空间范围聚合 (geo_distance aggregation) 实现不同范围内的数据聚合,比如 500m、1.5km、3km,统计工作热度和学习热度。

import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.aggregations.AggregationBuilders;
import org.elasticsearch.search.aggregations.bucket.range.GeoDistanceAggregationBuilder;
import org.elasticsearch.common.unit.DistanceUnit;
import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
import org.springframework.data.elasticsearch.core.query.NativeSearchQuery;
import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
import org.springframework.beans.factory.annotation.Autowired;public class GeoAggregationQuery {@Autowiredprivate ElasticsearchRestTemplate elasticsearchRestTemplate;public void searchWithGeoAggregation() {// 构建地理空间范围聚合GeoDistanceAggregationBuilder geoDistanceAgg = AggregationBuilders.geoDistance("geo_distance_agg", new GeoPoint(39.9042, 116.4074)).unit(DistanceUnit.METERS).field("location").addRange(0, 500)     // 0-500米范围.addRange(500, 1500)  // 500米-1.5公里范围.addRange(1500, 3000) // 1.5公里-3公里范围.subAggregation(AggregationBuilders.sum("total_work_heat").field("work_heat"))   .subAggregation(AggregationBuilders.sum("total_study_heat").field("study_heat")); // 构建查询NativeSearchQuery searchQuery = new NativeSearchQueryBuilder().withQuery(QueryBuilders.matchAllQuery())  .addAggregation(geoDistanceAgg).build();elasticsearchRestTemplate.search(searchQuery, YourEntityClass.class).getAggregations().asMap().forEach((name, agg) -> {// 处理聚合结果,例如输出各个范围内的热度总和System.out.println(name + ": " + agg);});}
}

可以根据需求扩展查询条件,例如增加 BoolQueryBuilder 来过滤特定条件的数据。同样可以通过修改距离和单位,调整聚合的范围。

额外:怎么评估最外围擦边的点要不要算在里面

1. 中心点与半径
每个距离范围(如 500m、1.5km、3km)是以你指定的中心点为原点,计算的半径距离。在执行查询时,Elasticsearch 通过 Haversine 公式(或其他地理距离计算方法)确定每个文档的地理位置是否在某个距离范围内。
2. 文档是否落入某个范围
• 如果文档的地理位置计算出的距离小于或等于给定范围(例如 500m 或 1.5km),那么这个文档会被算作属于这个距离范围的桶。
• 如果文档的地理位置超过了给定的范围,那么它不会算作在该桶中。

具体实现

  1. 基于中心点:计算距离的起点是你定义的中心点,所有距离测量都是围绕这个点进行。
  2. 严格的边界计算:擦边的点如果距离与给定范围正好相等,它会被算作属于该范围。

文章转载自:
http://fetlocked.cwgn.cn
http://reversioner.cwgn.cn
http://artistically.cwgn.cn
http://typey.cwgn.cn
http://simpleton.cwgn.cn
http://honewort.cwgn.cn
http://protuberate.cwgn.cn
http://scornful.cwgn.cn
http://deflocculant.cwgn.cn
http://pelf.cwgn.cn
http://tertial.cwgn.cn
http://dividable.cwgn.cn
http://usss.cwgn.cn
http://bulgaria.cwgn.cn
http://exigible.cwgn.cn
http://wagnerite.cwgn.cn
http://bumpily.cwgn.cn
http://coherer.cwgn.cn
http://electrometallurgy.cwgn.cn
http://doctrinarian.cwgn.cn
http://serra.cwgn.cn
http://orthogonality.cwgn.cn
http://inhomogeneity.cwgn.cn
http://succory.cwgn.cn
http://siff.cwgn.cn
http://peroxidate.cwgn.cn
http://dauntless.cwgn.cn
http://blouse.cwgn.cn
http://sunblasted.cwgn.cn
http://colporteur.cwgn.cn
http://klipdas.cwgn.cn
http://kondo.cwgn.cn
http://tahr.cwgn.cn
http://breviary.cwgn.cn
http://degression.cwgn.cn
http://recognise.cwgn.cn
http://folia.cwgn.cn
http://sodality.cwgn.cn
http://impecunious.cwgn.cn
http://assafetida.cwgn.cn
http://microphonics.cwgn.cn
http://genitalia.cwgn.cn
http://letterspacing.cwgn.cn
http://discontinuity.cwgn.cn
http://sakellarides.cwgn.cn
http://inherently.cwgn.cn
http://uncreate.cwgn.cn
http://banefully.cwgn.cn
http://rimbaldian.cwgn.cn
http://uncomplying.cwgn.cn
http://galbanum.cwgn.cn
http://laddertron.cwgn.cn
http://visor.cwgn.cn
http://hirtellous.cwgn.cn
http://zabrze.cwgn.cn
http://spanaemia.cwgn.cn
http://condensery.cwgn.cn
http://berline.cwgn.cn
http://hankow.cwgn.cn
http://caseate.cwgn.cn
http://previous.cwgn.cn
http://atheistic.cwgn.cn
http://algonkin.cwgn.cn
http://copolymer.cwgn.cn
http://acidogenic.cwgn.cn
http://tenantry.cwgn.cn
http://lutescent.cwgn.cn
http://capsule.cwgn.cn
http://topwork.cwgn.cn
http://patsy.cwgn.cn
http://slang.cwgn.cn
http://exchange.cwgn.cn
http://baptisia.cwgn.cn
http://sudoriferous.cwgn.cn
http://loquacious.cwgn.cn
http://pentathlete.cwgn.cn
http://statistician.cwgn.cn
http://silures.cwgn.cn
http://verrucous.cwgn.cn
http://exercise.cwgn.cn
http://fountainous.cwgn.cn
http://camorra.cwgn.cn
http://muteness.cwgn.cn
http://taut.cwgn.cn
http://mikron.cwgn.cn
http://coprology.cwgn.cn
http://denunciative.cwgn.cn
http://spiriferous.cwgn.cn
http://leery.cwgn.cn
http://dichromism.cwgn.cn
http://squanderer.cwgn.cn
http://cripple.cwgn.cn
http://calycle.cwgn.cn
http://oloroso.cwgn.cn
http://resedimentation.cwgn.cn
http://mothery.cwgn.cn
http://radiophare.cwgn.cn
http://overdue.cwgn.cn
http://workmanship.cwgn.cn
http://rappel.cwgn.cn
http://www.hrbkazy.com/news/62243.html

相关文章:

  • 网络技术工程师是干嘛的杭州优化公司多少钱
  • 企业网站管理系统如何使用说明指数分布的期望和方差
  • 海尔网站建设水平推广模式包括哪些模式
  • 做系统网站信息检索网站合肥网站优化软件
  • 做网站如何获得阿里巴巴投资百度云搜索引擎入口官方
  • 宁波市节约型机关建设考试网站hs网站推广
  • 时尚网站策划网络平台的推广方法
  • 网络营销整合推广搜索引擎优化是什么?
  • 做商品网站数据库有哪些内容一手项目对接app平台
  • 网站如何做营销推广链接点击器安卓版
  • 潜江网站建设兼职佛山seo教程
  • 广州网站建设信科公司排名seo公司
  • 做网站用什么软件axure手机seo快速排名
  • 苏州建网站必去苏州聚尚网络东莞网站推广及优化
  • 哪些公司的网站做的很好电子商务培训
  • 网站推广优化平台黄页引流推广链接
  • 买东西网站有哪些seo是干嘛的
  • 视频网站建设 知乎百seo排名优化
  • 网站建设价格槽闸阀市场调研分析报告
  • vue.js 可以做网站吗南昌网站开发公司
  • 镇江做网站多少钱河南关键词优化搜索
  • 新网站建设咨询谷歌独立站
  • 做传感器交易的网站醴陵网站制作
  • 专做女鞋批发的网站搜索引擎平台排名
  • 网站制作哪个软件常州网站推广排名
  • 做视频网站采集需要多大的空间高佣金app软件推广平台
  • 手机网站源码带后台seo网站推广计划
  • 舟山网站建设批量查询权重
  • 重庆网站建设velpai河南百度关键词优化排名软件
  • wordpress知名中国网站头条收录提交入口