当前位置:网站首页>高效探索|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:维度
边栏推荐
- joda. Time get date summary
- アルマ / 炼金妹
- 想买股票去哪个证券公司开户更快更安全
- Unity获取资源路径
- System dilemma and software complexity: Why are our systems so complex?
- Can TCP syn handshake messages transmit data
- Power representation in go language
- [200 opencv routines of youcans] 104 Motion blur degradation model
- ACWING2013. 三条线
- How to realize hierarchical management of application and hardware in embedded projects
猜你喜欢

Derivation of COS (a+b) =cosa*cosb-sina*sinb

Who can teach me how to learn SCM, what to learn first and how to get started?

原子Alpha开发板--SD卡和emmc烧录工具

How to find happiness in programming and get lasting motivation?
![[200 opencv routines of youcans] 104 Motion blur degradation model](/img/a9/8841ffc8bd3c486bc4011a1a84ff45.jpg)
[200 opencv routines of youcans] 104 Motion blur degradation model

System dilemma and software complexity: Why are our systems so complex?

joda.time获取日期总结

Introduction to sap ui5 tools

Esp8266 & sg90 steering gear & Lighting Technology & Arduino

Simple and complete steps of vivado project
随机推荐
Why did Yanjing Beer come here?
Jameswebb Space Telescope goes into operation to help study interstellar objects
How to deploy locally developed SAP ui5 applications to ABAP servers
Analysis of China's food cold chain logistics, output of quick-frozen noodles and rice products and operation of major enterprises in 2021 [figure]
The significance and proof of weak large number theorem
[core content and derivation] the mystery of human memory system may be just like this
Acwing2013. three lines
Cs8683 (120W mono class D power amplifier IC)
Qcom--lk phase I2C interface configuration scheme -i2c6
'how do I create an enumeration with constant values in rust?'- How can I create enums with constant values in Rust?
Unity get resource path
Metauniverse in 2022: robbing people, burning money and breaking through the experience boundary
爱情️终结者
Ht7180 3.7V L 12v/2a built in MOS high current boost IC solution
ACWING2013. 三条线
You can see the classification of SQL injection. SQL injection point /sql injection type /sql injection has several /sql injection point classifications
Derivation of sin (a+b) =sina*cosb+sinb*cosa
The most basic difference between clustering and classification.
How to configure log4j to only keep log files for the last seven days?
【2022黑马程序员】SQL优化