how to effectively run two inequality filters on queries in app engine

二次信任 提交于 2019-11-27 12:53:47

If it suits your data, you can discretize your X and Y into bins, generate a hash of the two values, and store that on the model. Then you can do exact lookups for the hash(es) which overlap the region you want to search within. Then, manually filter out the results which are outside your region.

This is essentially what geomodel is doing for latitude/longitude.

According to Alfred Fuller's recent Google I/O talk, they're working on support for multiple inequality filters on numeric properties.

Depending on what you're trying to do, you might find this MultiInequalityMixin interesting. It does pretty much what you describe, passing the first inequality through to Google's database and doing subsequent inequalities as filters. Disclaimer: it's a pretty sketchy implementation of an idea I had over a year ago and haven't really every finished off ...

If you need efficient indexing on two axes, then as Saxon Druce says, some kind of geohash etc algorithm is what's called for.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!