[appengine-java] Multiple contains() in a query

2010-02-22 Thread ka2
I was wondering if is there any way that this would be possible to implement. I have a search criteria that the user would fill out, most of the fields are multi-select, and none is required, so I need to generate the query dynamically (at least that would be a way to handle it in SQL, or store pro

Re: [appengine-java] Multiple contains() in a query

2010-02-26 Thread Ikai L (Google)
Yes, it is possible, but you need to be aware of limitations. I suggest understanding querying on List properties before starting: http://code.google.com/appengine/docs/java/datastore/queriesandindexes.html#Big_Entities_and_Exploding_Indexes

[appengine-java] Multiple contains() in a query and exploding indexes

2010-03-02 Thread Karel Alvarez
Hi Some time ago, I asked how to use multiple contains in a query, and I got some responses, that was great and I thank everybody for they help. I am posting my findings and advance in hope it might be useful for somebody trying to do the same. I am trying to build a database with real state listi

Re: [appengine-java] Multiple contains() in a query and exploding indexes

2010-03-02 Thread John Patterson
Hi Karel, Keep in mind that each time you modify a list and put it in memcache the whole list is serialized which is why you see it is expensive. There is an efficient approach to merging queries that does not need memcahe that Bret Slatkin called the "zig zag" method: http://www.scribd.

Re: [appengine-java] Multiple contains() in a query and exploding indexes

2010-03-02 Thread John Patterson
The zig zag method will help you with the AND part of your problem but the IN (OR) queries would need to be merged and ordered. If each query is ordered by __key_ - java.util.PriorityQueue could efficiently merge the parts of your IN query without needing to load them all into memory. Th