简体   繁体   English

Geosearch Search API GAE过滤距离(geopoint(MY_GEOPOINT),store_location)<DISTANCE查询

[英]Geosearch Search API GAE filtering distance(geopoint(MY_GEOPOINT), store_location) < DISTANCE queries

I in doubt about how the Search API makes the queries, especially how it scans the Documents in the Index. 我怀疑Search API如何进行查询,尤其是它如何扫描索引中的文档。 My doubt is the following: 我的疑问如下:

I have an Index with a lot of Documents with GeoPoints on it. 我有一个索引,上面有很多带有GeoPoints的文档。 I want to list the points that are in an specific radius. 我想列出特定半径内的点。 For example, if I have 20 millions Documents in the Index and do a search like this one: 例如,如果我在索引中有2000万个文档,并进行如下搜索:

String query = distance(geopoint(MY_GEOPOINT), store_location) < 10000

It will list the stores that are on the radius of 10 km. 它将列出半径10公里以内的商店。

My question is the following: How Search API are going to do it? 我的问题如下:Search API将如何做到? will it scans the 20 millions of documents(and take a long time) or it will optimize in some way? 它会扫描2000万个文档(并花费很长时间)还是会以某种方式进行优化?

I questioning because of performance, I am developing an app that will use GeoSearch and I'm afraid it with get slowly as the database grows. 我由于性能而提出质疑,我正在开发一个将使用GeoSearch的应用程序,但随着数据库的增长,它会变得越来越慢。

Thanks for any help. 谢谢你的帮助。 Kind Regards JLuiZ20 亲切的问候JLuiZ20

it will certainly not scan all records. 它当然不会扫描所有记录。 you can infer this from the documentation in https://cloud.google.com/appengine/training/fts_adv/ 您可以从https://cloud.google.com/appengine/training/fts_adv/中的文档中推断出这一点

Because geopoint is a supported data type and has the distance built-in function and supports geospatial queries, it can efficiently index geopoints in a way that it can query on a radius from a point. 因为geopoint是受支持的数据类型,并且具有内置的距离功能并支持地理空间查询,所以它可以以一种查询点的半径的方式有效地索引geopoint。 appengine docs don't mention the algorithm used, there are many such algorithms that it could be using but you bet its efficient, otherwise it wouldnt be a supported type. appengine文档没有提及所使用的算法,它可能会使用许多这样的算法,但是您敢打赌它会有效,否则它将不是受支持的类型。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM