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?
相关问题
- java.lang.NullPointerException at java.io.PrintWri
- __call__() missing 1 required positional argument:
- Upload file to Google Cloud Storage using AngularJ
- Where is the best place to put one-time and every-
- facebook “could not retrieve data from URL”
相关文章
- Is there a size limit for HTTP response headers on
- appcfg.py command not found
- Google app engine datastore string encoding proble
- Angular route not working when used with Google Ap
- Doctrine not finding data on Google App Engine?
- Using OkHttp client via OKClient on Google App Eng
- Google appEngine: 404 when accessing /_ah/api [dup
-
Google App Engine Error:
INVALID_ARGUMENT
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.
When I meat this problem (example searching range from - to) I use query with single inequality filter. Depending on sorting order (asc or desc) I select upper or bottom limit. After that I filter result programatically with bottom or upper limit that was not in query filter.
Whether there is a workaround for having a single inequality filter per query depends on the type of dataset you are querying over.
For instance, if you wanted to query positional data using a latitude and longitude address, you'd typically need to query for a range of values on two properties (lat and long). However, with a geohash algorithm you can accomplish an equivalent query using only a single property.