简体   繁体   English

空间搜索对象化,appengine

[英]Spatial Search Objectify, appengine

I want to use, objectify for spatial search. 我想使用对象化进行空间搜索。 I have entities that have longitude and latitude associated with them. 我有与之相关联的经度和纬度的实体。 Latitude and longitude information is dynamic eg service providers (like electrician, carpenter) in a city. 纬度和经度信息是动态的,例如城市中的服务提供商(如电工,木匠)。 I want to implement a query that gives me service providers providing some specific service in 1 Km radius. 我想实现一个查询,使我的服务提供商可以在1 Km半径内提供某些特定服务。 Searching on google reveals following options 在Google上搜索显示以下选项

  1. Use Objectify with geohashes - Not sure, how accurate and scalable this solution is 将Objectify与geohashs一起使用-不确定,此解决方案的准确性和可扩展性
  2. Use Google Search - It will need entities(or part of it) duplicated in the form of documents and Will it be able to support dynamically updated locations. 使用Google搜索-它需要以文档形式重复的实体(或实体的一部分),并且能够支持动态更新的位置。
  3. Use other database like mongodb 使用其他数据库,例如mongodb

Assuming few millions entities and latitude/longitude dynamically updated, please suggest me an appropriate option. 假设数百万个实体和纬度/经度是动态更新的,请为我建议一个适当的选项。

thanks Ittium 谢谢Ittium

I've used geohashes. 我已经使用了geohashes。 It works, although you end up selecting more data than the exact bounds you are looking for and then filtering out the extra. 尽管您最终选择的数据超出了您要查找的确切范围,然后又过滤掉了多余的数据,但它仍然有效。 This might or might not be a good solution depending on your specific application. 根据您的特定应用程序,这可能不是一个好的解决方案。 It requires writing more code but has fewer moving parts (all in the datastore). 它需要编写更多代码,但活动部分更少(全部在数据存储区中)。

Google search and "other database" are basically the same architectural pattern - use the task queue to replicate updates to an external index. Google搜索和“其他数据库”基本上是相同的架构模式-使用任务队列将更新复制到外部索引。 If you want a quick solution, the search service is probably is the easiest to wrap your head around. 如果您需要快速的解决方案,那么搜索服务可能是最简单的选择。

Just pick one solution and run with it for a while. 只需选择一种解决方案并运行一段时间即可。 You can always reindex the data into a different solution. 您始终可以将数据重新索引到其他解决方案中。

It really depends on your query rate but I usually prefer to use google search. 这实际上取决于您的查询率,但我通常更喜欢使用Google搜索。 Building and maintaining docs is pretty simple and you get a different quota to handle this queries. 构建和维护文档非常简单,您将获得不同的配额来处理此查询。

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

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