当前位置:网站首页>高效探索|ES地理位置查询的一次应用实践
高效探索|ES地理位置查询的一次应用实践
2022-06-25 06:37:00 【星星都掉了】
最近参加一个开发需求评审,要实现一个根据经纬度和距离查询数据的功能。
一开始听到做这个需求有点头大,丝毫没有头绪。
正在我想实现方法时候,一个架构大佬自信满满的说通过高德地图可以实现,不过查询的范围不是一个圆,而是一个长方形。emmm...产品咬咬牙同意了。
需求评审结束后,管理后台和web端根据这个方向,在互联网的大海里飘荡,最后找到一个实现方法。拷贝、调试、发布,在经过一顿猛如虎的操作后,功能提测了。
不出意外,测试的时候,漏洞百出。再往后发现,当个人的经纬度,定位到其他城市,再查询某个距离范围的数据,相差50-100公里,结果页面居然有数据。
没办法,只能重新实现了。。。
后来经一个同事说es有根据经纬度查询功能,我就在网上找api,结果还真找到了。在经过跟运维同事一次次部署、联调后,功能实现了。下面就是实现配置的过程:
1.es版本:
2.数据库版本:
3.数据库配置sql:
4.关键转换配置:
5.数据输出到es:
6.映射模板配置:
7.kibnan查询:
至此,功能实现,一个所传经纬度为圆点,200KM以内的数据都会查出来
注: longitude:经度 coordinate:维度
边栏推荐
- [Shangshui Shuo series] day 4
- Metauniverse in 2022: robbing people, burning money and breaking through the experience boundary
- You can see the classification of SQL injection. SQL injection point /sql injection type /sql injection has several /sql injection point classifications
- 原子Alpha开发板--SD卡和emmc烧录工具
- Cve-2022-23131 - bypass SAML SSO authentication
- Can TCP syn handshake messages transmit data
- 2022 biological fermentation Exhibition (Jinan), which is a must read before the exhibition. The most comprehensive exhibition strategy will take you around the "fermentation circle"
- Tp6 interface returns three elements
- Bcrypt password encryption kalrry
- We cannot activate inspection type for article master in transaction code MM41?
猜你喜欢
cos(a+b)=cosa*cosb-sina*sinb的推导过程
Keil debug view variable prompt not in scope
Following the last minor upgrade of nodemcu (esp8266)
Non-contact infrared temperature measurement system for human body based on single chip microcomputer
ACWING/2004. 錯字
From file system to distributed file system
Ctfhub web - divulgation d'informations - traversée du Répertoire
Cannot activate inspection type when SAP retail uses transaction code mm41 to create commodity master data?
SAP QM executes the transaction code qp01, and the system reports an error -material type food is not defined for task list type Q-
Ht81293 built in adaptive dynamic boost 20W mono class D power amplifier IC solution
随机推荐
原子Alpha开发板--SD卡和emmc烧录工具
有能力的人从不抱怨大环境!
Analysis of common interview questions in redis
Missing libgmp-10 dll - libgmp-10. dll is missing
Navicat prevent new query from being deleted by mistake
Capable people never complain about the environment!
Ht81293 built in adaptive dynamic boost 20W mono class D power amplifier IC solution
Direct select sort and quick sort
Streaming a large file using PHP
Meta universe is over, Web 3.0 will be fooled again?
Hongmeng learning notes: creating layouts using XML
Which securities company do you want to buy stocks to open an account faster and safer
Are you still doing the dishes yourself? Teach you how to make dishwasher controller with single chip microcomputer
[Shangshui Shuo series] day 5
Power representation in go language
Unity get resource path
Design of PWM breathing lamp based on FPGA
Baidu map - introductory tutorial
レレ / 蕾蕾
Comparison test of mono 120W high power class D power amplifier chip cs8683-tpa3116