AppEngine Datastore中的不等式筛选 [英] Inequality Filter in AppEngine Datastore

查看:81
本文介绍了AppEngine Datastore中的不等式筛选的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,Google AppEngine每个查询只支援一个不等式筛选器。什么是这个限制的解决方法?是否有任何解决方案可以提供类似的效果?

解决方案

实际上,GAE支持多个不等式过滤器,只要它们是位于同一地产上。



这个限制的解决方法是数据特定的,例如它取决于数据的结构以及查询方式。例如,对于地理搜索,正如@Dan Holevoet提到的那样,存在各种地理散列算法。
基本上所有这些算法都涉及将多个属性合并为一个属性并同时量化属性(创建离散值)。例如,地理散列涉及将世界地图划分成小的固定尺寸区域(=合并经纬度和量化),以便能够通过相等运算符进行搜索。

I understand that Google AppEngine supports only one inequality filter per query. What are the workaround on this limitation? Are there any solution that will provide similar effect?

解决方案

Actually GAE supports multiple inequality filters as long as they are on the same property.

The workarounds to this limitation are data-specific, e.g. it depends how your data is structured and how you want to query it. For example, for geo searching, as @Dan Holevoet mentioned, there are various geo-hashing algorithms. Basically all such algorithms involve combining multiple properties into one and at the same time quantizing the property (creating discrete values). For example geo-hashing involves dividing up the world map into small fixed-size areas (= combining lat/lon and quantizing) in order to be able to search via equality operator.

这篇关于AppEngine Datastore中的不等式筛选的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆