What about two queries, one for the range, one for the date then take the
union of the two sets?

On Sat, Mar 13, 2010 at 8:49 AM, Tim Hoffman <[email protected]> wrote:

> Yuchh
>
> Ignore this.  That will teach me for posting whilst half asleep.
>
> Complete rubbish
>
> T
>
> On Mar 13, 11:50 pm, Tim Hoffman <[email protected]> wrote:
> > Hi
> >
> > You could try this.
> >
> > Create a composite string field of all three values padded with 0's
> > for the numerics so that they will sort alphabetically
> >
> > for instance a new field (composite_field)   date + foo + bar
> >
> > where date   20100221  (YYYYMMDD)
> > foo is 000000002
> > bar is 000000041
> >
> > So your field value will be
> >
> > 20100221000000002000000041
> >
> > Now you can use multiple inequality filters on the same field
> >
> > For instance
> > assuming the date we want is >  01 jan 2010
> > and we want foo > 0
> > and bar < 42
> >
> > Query q =  new Query("MyKind")
> >         .addFilter("composite_field", GREATER_THAN,
> > '20100101000000000')     Which sorts the date > 01 Jan 2010 and foo >
> > 1
> >         .addFilter("composite_field", LESS_THAN,
> > '20100101000000000000000042');   which gets you the less than 42
> >
> > It might work for you.
> >
> > Cheers
> >
> > T
> >
> > On Mar 13, 7:53 pm, Patrick Twohig <[email protected]> wrote:
> >
> >
> >
> > > So, the business requirements of my application need a query which
> needs to
> > > search for a property (let's call it "foo") and a date property such
> that it
> > > will filter out all objects older than a certain date.  I guess in
> GAE/J
> > > this would be something like....
> >
> > > Query q =  new Query("MyKind")
> > >         .addFilter("foo", GREATER_THAN, 0)
> > >         .addFilter("bar", LESS_THAN, 42)
> > >         .addFilter("date", GREATER_THAN, someDate);
> >
> > > But, I'm guessing that wouldn't work because it's got inequality
> filters on
> > > multiple properties.  Would there be a way to get a similar result
> without
> > > loading a huge amount of entities into memory and filtering them out
> > > manually?
> >
> > > --
> > > Patrick H. Twohig.
> >
> > > Namazu Studios
> > > P.O. Box 34161
> > > San Diego, CA 92163-4161
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-appengine%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>
>


-- 
Patrick H. Twohig.

Namazu Studios
P.O. Box 34161
San Diego, CA 92163-4161

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to