Magento 地理搜索和产品推荐
我正在为一家旅游公司评估 Magento,该公司需要根据地理距离进行产品搜索和推荐。该公司正在根据各种组成部分(例如:住宿、旅游、餐厅优惠券等)创建定制度假套餐。这些组件可能具有重叠的位置(即:特定的旅行可能距离几家酒店足够近,以被视为与它们中的每一个相关)。
当用户通过添加在不同酒店的住宿来构建自定义套餐时,我希望根据地理位置显示相关产品推荐。而且,如果他们搜索旅行,我希望将距离较近的旅行加权到目录搜索结果的顶部。
很高兴拥有:用户能够选择他们认为“足够近”的距离(例如:10 公里、50 公里、200 公里等)。
我的研究表明 Magento 中没有对任何类型的空间查询的开箱即用的支持。我能想到的最佳解决方案是自定义产品属性,其中列出了每个产品手动分配到各个位置的“位置”。但我认为对于超过 50 个地点来说,管理起来会非常困难。我的研究正确吗?是否有一个附加组件/扩展可以满足这种情况?您认为后端可以管理重叠的 50 个位置吗?
来自 Microsoft 的背景,我自然倾向于启用 SQL Server 2008+ 空间功能并在数据库中执行查询。显然,这个选项在 LAMP 堆栈中不可用。我错了吗? MySQL 是否支持空间查询,如 WHERE ProductA.Location.GetDistanceFrom(productB.Location) 50公里?
I'm evaluating Magento for a travel company who will need to do product searches and recommendations based on geographical distance. The company is creating custom holiday packages based on various components (eg: accommodation, tours, restaurant vouchers, etc). These components potentially have overlapping locations (ie: a particular tour might be close enough to several hotels to be considered related to each of them).
As a user builds up their custom package by adding stays at various hotels, I'd like related product recommendations to appear based on geographical location. And, if they search for tours, I'd like closer tours to be weighted toward the top of the catalogue search results.
Nice to have: the ability for the user to select how close / far they consider "close enough" to be (eg: 10km, 50km, 200km, etc).
My research indicates there isn't out of the box support for any sort of spatial queries in Magento. The best solution I could come up with was custom product attributes which list "location" where each product is manually assigned to various locations. But I think that's going to get pretty hard to manage for more than ~50 locations. Is my research correct? Is there an add-on / extension which will fulfil this scenario? Do you think overlapping 50 locations will be manageable in the backend?
Coming from a Microsoft background, my natural inclination would be to enable SQL Server 2008+ spacial functionality and do the queries in the database. Obviously, this option isn't available in the LAMP stack. Am I wrong? Does MySQL support spatial queries like WHERE productA.Location.GetDistanceFrom(productB.Location) < 50km
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Mysql 也支持空间查询 http://dev.mysql.com /doc/refman/4.1/en/spatial-extensions.html 但没有什么可以帮助您或让您免于输入产品与其位置之间的关系,您必须自己实现它并根据地点
Mysql supports spatial queries as well http://dev.mysql.com/doc/refman/4.1/en/spatial-extensions.html but nothing will help you or free you from entering the relations between products and it's location and you have to implement it yourself as well as extend the search based on location