Try adding a limit to the count query

On Sun, Dec 19, 2010 at 6:35 PM, Zsombor <gzsom...@gmail.com> wrote:

> Hi,
>
>  I'm using the low level API, and noticed something strange:
> If I call :
>
> service.prepare(
>    new Query(USER_KIND).addFilter("active", FilterOperator.EQUAL,
> Boolean.TRUE)
>          .addFilter("registrationDate",
> FilterOperator.GREATER_THAN_OR_EQUAL, date).setKeysOnly())
>         .countEntities(FetchOptions.Builder.withDefaults())
>
> it returns 0.
>
> However If I call:
> service.prepare(
>    new Query(USER_KIND).addFilter("active", FilterOperator.EQUAL,
> Boolean.TRUE)
>          .addFilter("registrationDate",
> FilterOperator.GREATER_THAN_OR_EQUAL, date).setKeysOnly())
>         .asList(FetchOptions.Builder.withDefaults()).size()
>
> it returns 3 - in this case this is the correct answer. I'm very
> curious what happens here. Is there a problem with the indexes? But if
> I not correctly configured my indexes, I guess, the second query
> should fail similarly with returning 0 entity.
>
> Any thought ? Is it a bug in the datastore ?
>
> BR
>  Zsombor
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com<google-appengine-java%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>


-- 
Guit: Elegant, beautiful, modular and *production ready* gwt applications.

http://code.google.com/p/guit/

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to