[google-appengine] GQL queries of Datastore via command-line tool like gcloud, bq, other?

2017-06-30 Thread Brian Miller

Hello,

I have been using the "Datastore" feature with Google App Engine,
and querying data via

(1) Java-based application our team wrote, which runs in deployed Google 
App Engine environment
(2) web console of Google Cloud Platform, via 
https://console.cloud.google.com/datastore/entities/query?project=PROJECTNAME
 (Query by kind) and

https://console.cloud.google.com/datastore/entities/query/gql?project=PROJECTNAME
 
(Query by GQL)

I recently started experimenting with the command-line tools provided
with the google-cloud-sdk, such as google-cloud-sdk/bin/gcloud

I noticed that there are commands:

gcloud datastore create-indexes index.yaml
gcloud datastore cleanup-indexes index.yaml

I was hoping there might be a way to use gcloud (or other command-line tool)
to perform GQL queries like "SELECT * FROM MyDatastoreName"

I also noticed there is another tool called "bq" for BigQuery,
but we do not have datasets in BigQuery.

Is there an existing command-line tool for querying datastores,
or would I need to write my own?

Thanks,

Brian Miller


-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/a3004833-d511-4c0d-80d7-82134ced9be1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Datastore queries are unpredictably slow when a limit is applied

2017-03-04 Thread Arjunkumar Udainath
I have an app that's sort of like a to-do application. Any given user would 
have "Tasks" that are pending at any given time. The number of tasks 
pending for a user can range from 0 to 5000. I need to fetch the pending 
tasks (or at least a small batch) for each user when they load the page.

How do I make sense of these latencies:

*Scenario 1:*

User A: Has 2500 pending tasks. The query limit is 500 and results fetched 
on the first request are obviously 500. Time taken: 5767 milliseconds (5.7 
seconds).

User B: Has 2 pending tasks. The query limit is 500 and results fetched on 
the first request are obviously 2. Time taken: 7124 milliseconds (7.1 
seconds).

*Scenario 2:*

User A: Has 2500 pending tasks. The query limit is 10 and results fetched 
on the first request are obviously 10. Time taken: ~400 milliseconds (1/2 
second).

User B: Has 2 pending tasks. The query limit is 10 and results fetched on 
the first request are obviously 2. Time taken: 5-6 seconds.
I thought I could speed up the query if I knew what the limit would be for 
users with fewer than 500. So there is a user with 551 tasks. Here's what 
happened:

*Scenario 3:*

User A: Has 2500 pending tasks. The query limit is 551 and results fetched 
on the first request are obviously 551. Time taken: 6251 milliseconds (6 
seconds).

User B: Has 551 pending tasks. The query limit is 551 and results fetched 
on the first request are obviously 551. Time taken: 13053 milliseconds (13 
seconds).

I can't find a pattern here. How do I optimize my queries so that users 
with less data can get their pages loaded quickly.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/20d18d07-90c2-4c4b-8b47-2316d425c152%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] In queries and cursors limitation

2017-01-17 Thread Rajesh Gupta
I have the following

Public class Invoice {
  @Id Long id
   Key partyKey;
   Status status
}

enum Status {
  PAID, PARTIAL_PAID, PENDING, DRAFT
}

I want to find all invoices with Status = PAID, PARTIAL_PAID, so I do the
IN query

ofy.query(Invoice.class).filter("status in", [PAID,
PARTIAL_PAID]).limit(100).list()

However, then, if I want the next 100, the cursor will not work because of
IN query

What are the alternate solutions or schemas'.

-- 
Regards,
Rajesh
*www.VeersoftSolutions.com *
*www.GainERP.com *
*Accounting/Inventory/Orders/Sales/Purchase on Google Cloud Platform and
Mobile*

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/CA%2BS7ijY%2BfSo3_Czf3QD2Bd9GnJ-YD72FChTj1bo2J4OUZEBHPA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Location queries via Search API on development server not working

2013-07-15 Thread Aaron Steele
Loving the new Search API in the Python runtime. As of 1.8.1 the location 
queries aren't working for me on the development server. The same code 
works when deployed to production. Any workarounds for that?

Cheers,
Aaron

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.




[google-appengine] GQL Queries involving Keys is broken in Admin console

2013-02-24 Thread Aswath Satrasala
Hello,
For a given namespace, I am not able to do queries involving keys and get
correct results in the Admin console.
Any one experiencing this issue?

-Aswath

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [google-appengine] Data queries returning with partial data after migration

2013-02-20 Thread Brian Quinlan
Hi Eran,

Non-ancestor queries are eventually consistent. See:
https://developers.google.com/appengine/docs/python/datastore/queries#Data_Consistency

Cheers,
Brian

On Fri, Feb 15, 2013 at 5:50 AM, Eran Schaffer eran.schaf...@gmail.com wrote:
 Hi,
 I finished migrating my DB from m/s to high replication, and while I am
 seeing all the data using  datastore viewer and GQL ,
 when my website's code does a similar query I only get partial results,
 meaning not all entries in the DB get back.

 Did anyone experience something similar?

 FYI, I deployed my app before migration , and the relevant indexes for these
 classes are tagged as Serving

 Thanks, ES

 --
 You received this message because you are subscribed to the Google Groups
 Google App Engine group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-appengine+unsubscr...@googlegroups.com.
 To post to this group, send email to google-appengine@googlegroups.com.
 Visit this group at http://groups.google.com/group/google-appengine?hl=en.
 For more options, visit https://groups.google.com/groups/opt_out.



-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[google-appengine] Data queries returning with partial data after migration

2013-02-20 Thread Eran Schaffer
Hi,
I finished migrating my DB from m/s to high replication, and while I am 
seeing all the data using  datastore viewer and GQL , 
when my website's code does a similar query I only get partial results, 
meaning not all entries in the DB get back.

Did anyone experience something similar?

FYI, I deployed my app before migration , and the relevant indexes for 
these classes are tagged as Serving

Thanks, ES

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[google-appengine] Re: Queries hitting deadline

2012-09-15 Thread Nadir
Hi, i think 
Cursorshttps://developers.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/Cursor
  
is what you need.

On Friday, August 24, 2012 12:26:00 AM UTC+5, Phil wrote:

 In some initialization work my app needs to run through the all of the 
 datastore entities of a given kind.  I have a lot of these entities (80k 
 currently) and it's increasing rapidly. I'm currently trying to read these 
 in using a single datastore query, but running up against the default 
 datastore timeout of 30 seconds.

 Is there a good practice for sharding this or otherwise breaking this up 
 so that I won't hit these deadlines? I was thinking I would do a keyOnly 
 query and then break up the keys into a number of reasonably sized 
 sub-queries, but perhaps there is a better approach out there?

 Thanks,
 Phil


-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/84qv8fTzmMIJ.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



[google-appengine] Re: Queries hitting deadline

2012-09-09 Thread kscott
All depends on what you are doing.   I ended up denormalizing my data 
model.  So I could retrieve my Images by a key or id.  I use another table 
to link stuff together.

class ThumbStore(db.Model):
thumbId=db.IntegerProperty()
imageId=db.IntegerProperty()
thumbnail=db.BlobProperty()
filename=db.StringProperty() # just for ref in dataviewer

class StoryIdx(db.Model):
storyId=db.IntegerProperty()
thumbId=db.IntegerProperty()
imageId=db.IntegerProperty()
textId = db.IntegerProperty()

So instead  of querying the ThumbStore that will hit a dead line error.  I 
search the StoryIdx table first to find the keys I need in the Thumb table.

see my site:

http://www.hikejournal.com



On Thursday, August 23, 2012 2:26:00 PM UTC-5, Phil wrote:

 In some initialization work my app needs to run through the all of the 
 datastore entities of a given kind.  I have a lot of these entities (80k 
 currently) and it's increasing rapidly. I'm currently trying to read these 
 in using a single datastore query, but running up against the default 
 datastore timeout of 30 seconds.

 Is there a good practice for sharding this or otherwise breaking this up 
 so that I won't hit these deadlines? I was thinking I would do a keyOnly 
 query and then break up the keys into a number of reasonably sized 
 sub-queries, but perhaps there is a better approach out there?

 Thanks,
 Phil


-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/z4-1VTymnjUJ.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



[google-appengine] Re: Queries hitting deadline

2012-08-24 Thread timh
If your count keeps increasing you will always run into some sort of time 
limit.  Why not consider doing this processing in a task (they can run for 
10mins, or multiple tasks. )  I am assuming your trying to summarise etc

T

On Friday, August 24, 2012 3:26:00 AM UTC+8, Phil wrote:

 In some initialization work my app needs to run through the all of the 
 datastore entities of a given kind.  I have a lot of these entities (80k 
 currently) and it's increasing rapidly. I'm currently trying to read these 
 in using a single datastore query, but running up against the default 
 datastore timeout of 30 seconds.

 Is there a good practice for sharding this or otherwise breaking this up 
 so that I won't hit these deadlines? I was thinking I would do a keyOnly 
 query and then break up the keys into a number of reasonably sized 
 sub-queries, but perhaps there is a better approach out there?

 Thanks,
 Phil


-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/5x0WQc9ODVwJ.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



Re: [google-appengine] Re: Queries hitting deadline

2012-08-24 Thread Phil McDonnell
I can definitely do the work in a task, but the deadline I'm hitting is the
read deadline from the datastore. I believe that will be the same for
tasks, right?

Thanks,
Phil


On Fri, Aug 24, 2012 at 12:18 AM, timh zutes...@gmail.com wrote:

 If your count keeps increasing you will always run into some sort of time
 limit.  Why not consider doing this processing in a task (they can run for
 10mins, or multiple tasks. )  I am assuming your trying to summarise etc

 T


 On Friday, August 24, 2012 3:26:00 AM UTC+8, Phil wrote:

 In some initialization work my app needs to run through the all of the
 datastore entities of a given kind.  I have a lot of these entities (80k
 currently) and it's increasing rapidly. I'm currently trying to read these
 in using a single datastore query, but running up against the default
 datastore timeout of 30 seconds.

 Is there a good practice for sharding this or otherwise breaking this up
 so that I won't hit these deadlines? I was thinking I would do a keyOnly
 query and then break up the keys into a number of reasonably sized
 sub-queries, but perhaps there is a better approach out there?

 Thanks,
 Phil

  --
 You received this message because you are subscribed to the Google Groups
 Google App Engine group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-appengine/-/5x0WQc9ODVwJ.
 To post to this group, send email to google-appengine@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-appengine?hl=en.


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



Re: [google-appengine] Projection Queries does not work with order() and Limit parameter

2012-06-20 Thread timh

 

 I just added a few more records. The new ones appear without trouble. 
 Missing records seems to be the ones saved before the projection index was 
 created.



If you added a new index, then pre-existing items won't be in the index, 
unless it's rebuilt.  Did you add new properties when you added
the projection index ? 

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/jQK08_9rQksJ.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



Re: [google-appengine] Projection Queries does not work with order() and Limit parameter

2012-06-20 Thread Christopher Ramírez
No as I remember.

How can I rebuild an Index?

On Wednesday, June 20, 2012 2:53:12 AM UTC-6, timh wrote:


  

 I just added a few more records. The new ones appear without trouble. 
 Missing records seems to be the ones saved before the projection index was 
 created.



 If you added a new index, then pre-existing items won't be in the index, 
 unless it's rebuilt.  Did you add new properties when you added
 the projection index ? 


-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/a6RsWljZlHYJ.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



Re: [google-appengine] Projection Queries does not work with order() and Limit parameter

2012-06-20 Thread Alfred Fuller
App Engine handles index building for you. When you add a new index, it
will re-index all entities.

However, it is possible to save entities with an 'unindexed' property, then
change the model definition to save the same property but 'indexed.' In
this case, the old entities will remain unindexed, while new entities will
be indexed. The only way to fix this is to re-write the old entities (as
switching the indexing of a property is a schema change, and the datastore
does not manage your schema).

On Wed, Jun 20, 2012 at 8:37 AM, Christopher Ramírez 
blindedbythed...@gmail.com wrote:

 No as I remember.

 How can I rebuild an Index?


 On Wednesday, June 20, 2012 2:53:12 AM UTC-6, timh wrote:




 I just added a few more records. The new ones appear without trouble.
 Missing records seems to be the ones saved before the projection index was
 created.



 If you added a new index, then pre-existing items won't be in the index,
 unless it's rebuilt.  Did you add new properties when you added
 the projection index ?

  --
 You received this message because you are subscribed to the Google Groups
 Google App Engine group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-appengine/-/a6RsWljZlHYJ.

 To post to this group, send email to google-appengine@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-appengine?hl=en.


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



Re: [google-appengine] Projection Queries does not work with order() and Limit parameter

2012-06-20 Thread Christopher Ramírez
Thanks Alfred! Nice answare.

Now that you point me indexed property, I remember I changed it for some 
fields included in the proyection. Some of them were not indexed before 
been in the proyection. So, that coud be the issue.

On Wednesday, June 20, 2012 10:30:35 AM UTC-6, Alfred Fuller wrote:

 App Engine handles index building for you. When you add a new index, it 
 will re-index all entities.

 However, it is possible to save entities with an 'unindexed' property, 
 then change the model definition to save the same property but 'indexed.' 
 In this case, the old entities will remain unindexed, while new entities 
 will be indexed. The only way to fix this is to re-write the old entities 
 (as switching the indexing of a property is a schema change, and the 
 datastore does not manage your schema).

 On Wed, Jun 20, 2012 at 8:37 AM, Christopher Ramírez 
 blindedbythed...@gmail.com wrote:

 No as I remember.

 How can I rebuild an Index?


 On Wednesday, June 20, 2012 2:53:12 AM UTC-6, timh wrote:


  

 I just added a few more records. The new ones appear without trouble. 
 Missing records seems to be the ones saved before the projection index was 
 created.



 If you added a new index, then pre-existing items won't be in the index, 
 unless it's rebuilt.  Did you add new properties when you added
 the projection index ? 

  -- 
 You received this message because you are subscribed to the Google Groups 
 Google App Engine group.
 To view this discussion on the web visit 
 https://groups.google.com/d/msg/google-appengine/-/a6RsWljZlHYJ.

 To post to this group, send email to google-appengine@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-appengine+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/google-appengine?hl=en.




-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/eeTWsQev-f8J.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



Re: [google-appengine] Projection Queries does not work with order() and Limit parameter

2012-06-19 Thread Christopher Ramírez
Yes it happens on both servers.

On Monday, June 18, 2012 11:01:08 AM UTC-6, Alfred Fuller wrote:

 Does this happen in both the dev_appserver and production?

 On Fri, Jun 15, 2012 at 10:28 AM, Christopher Ramírez 
 blindedbythed...@gmail.com wrote:

 I was trying to use projection queries, but I had extrange issues using 
 them.

 I'm trying to use them like this:
 offset_group = Clients.all( \
 projection=('name', 'sex', 'birth_date', 'email', 'discount')
 ).order('-__key__').fetch(limit=10, offset=skip_recs)

 The above code is supposed to bring me the last 10 clients. But actually 
 it does not return the last 10 (actually returns fewer and the actual last 
 record is not included). Also the results seems alternated or maybe 
 even/odd are skipped. If I take off projection param, the result is as 
 spected:
 offset_group = Clients.all().order('-__key__').fetch(limit=10, 
 offset=skip_recs)

 I do not know if this is a bug in projection queries or they have to be 
 used in a different way. Please help me. I would like to use projection 
 queries because they are really fast!

 Kind Regards,
 Christopher Ramírez

 -- 
 You received this message because you are subscribed to the Google Groups 
 Google App Engine group.
 To view this discussion on the web visit 
 https://groups.google.com/d/msg/google-appengine/-/Ahgw_iP_mukJ.
 To post to this group, send email to google-appengine@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-appengine+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/google-appengine?hl=en.




-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/_oXSMPD4KccJ.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



Re: [google-appengine] Projection Queries does not work with order() and Limit parameter

2012-06-19 Thread timh
I haven't used projections in queries, but I was just reading the docs and 
noted the following about indexes.

projectionList or tuple of names of properties to return. Only entities 
possessing the specified properties will be returned. If not specified, 
entire entities are returned by default. Projection 
querieshttps://developers.google.com/appengine/docs/python/datastore/queries#Projection_Queries
 are 
faster and cheaper than those that return complete entitites.

*Note:* Specifying this parameter may change the query's index requirements.
Maybe you have added the projection arg and are encountering an index that 
hasn't been rebuilt.  That could be one explanation. 
The other thing to check would be if the missing records have values for 
the properties specified in the projection.

Rgds

T

On Tuesday, June 19, 2012 10:35:32 PM UTC+8, Christopher Ramírez wrote:

 Yes it happens on both servers.

 On Monday, June 18, 2012 11:01:08 AM UTC-6, Alfred Fuller wrote:

 Does this happen in both the dev_appserver and production?

 On Fri, Jun 15, 2012 at 10:28 AM, Christopher Ramírez 
 blindedbythed...@gmail.com wrote:

 I was trying to use projection queries, but I had extrange issues using 
 them.

 I'm trying to use them like this:
 offset_group = Clients.all( \
 projection=('name', 'sex', 'birth_date', 'email', 'discount')
 ).order('-__key__').fetch(limit=10, offset=skip_recs)

 The above code is supposed to bring me the last 10 clients. But actually 
 it does not return the last 10 (actually returns fewer and the actual last 
 record is not included). Also the results seems alternated or maybe 
 even/odd are skipped. If I take off projection param, the result is as 
 spected:
 offset_group = Clients.all().order('-__key__').fetch(limit=10, 
 offset=skip_recs)

 I do not know if this is a bug in projection queries or they have to be 
 used in a different way. Please help me. I would like to use projection 
 queries because they are really fast!

 Kind Regards,
 Christopher Ramírez

 -- 
 You received this message because you are subscribed to the Google 
 Groups Google App Engine group.
 To view this discussion on the web visit 
 https://groups.google.com/d/msg/google-appengine/-/Ahgw_iP_mukJ.
 To post to this group, send email to google-appengine@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-appengine+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/google-appengine?hl=en.




-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/WmBg8skHXTAJ.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



Re: [google-appengine] Projection Queries does not work with order() and Limit parameter

2012-06-19 Thread Christopher Ramírez
Hello Tim!

I checked your the points.

   the missing records have values for the properties specified in the 
 projection. 

Yes, they have. I just even updated them in the datastore admin 
(production) and still don't appear.

 an index that hasn't been rebuilt 

I ran appcfg.py update_indexed and the problem still persists.

Another problem is that I'm specifing a limit of 20 records, but the 
projection query return me only 10 records. Actually, total existing 
instances are 20

I just added a few more records. The new ones appear without trouble. 
Missing records seems to be the ones saved before the projection index was 
created.

On Tuesday, June 19, 2012 7:11:50 PM UTC-6, timh wrote:

 I haven't used projections in queries, but I was just reading the docs and 
 noted the following about indexes.

 projectionList or tuple of names of properties to return. Only entities 
 possessing the specified properties will be returned. If not specified, 
 entire entities are returned by default. Projection 
 querieshttps://developers.google.com/appengine/docs/python/datastore/queries#Projection_Queries
  are 
 faster and cheaper than those that return complete entitites.

 *Note:* Specifying this parameter may change the query's index 
 requirements.
 Maybe you have added the projection arg and are encountering an index that 
 hasn't been rebuilt.  That could be one explanation. 
 The other thing to check would be if the missing records have values for 
 the properties specified in the projection.

 Rgds

 T

 On Tuesday, June 19, 2012 10:35:32 PM UTC+8, Christopher Ramírez wrote:

 Yes it happens on both servers.

 On Monday, June 18, 2012 11:01:08 AM UTC-6, Alfred Fuller wrote:

 Does this happen in both the dev_appserver and production?

 On Fri, Jun 15, 2012 at 10:28 AM, Christopher Ramírez 
 blindedbythed...@gmail.com wrote:

 I was trying to use projection queries, but I had extrange issues using 
 them.

 I'm trying to use them like this:
 offset_group = Clients.all( \
 projection=('name', 'sex', 'birth_date', 'email', 'discount')
 ).order('-__key__').fetch(limit=10, offset=skip_recs)

 The above code is supposed to bring me the last 10 clients. But 
 actually it does not return the last 10 (actually returns fewer and the 
 actual last record is not included). Also the results seems alternated or 
 maybe even/odd are skipped. If I take off projection param, the result is 
 as spected:
 offset_group = Clients.all().order('-__key__').fetch(limit=10, 
 offset=skip_recs)

 I do not know if this is a bug in projection queries or they have to be 
 used in a different way. Please help me. I would like to use projection 
 queries because they are really fast!

 Kind Regards,
 Christopher Ramírez

 -- 
 You received this message because you are subscribed to the Google 
 Groups Google App Engine group.
 To view this discussion on the web visit 
 https://groups.google.com/d/msg/google-appengine/-/Ahgw_iP_mukJ.
 To post to this group, send email to google-appengine@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-appengine+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/google-appengine?hl=en.




-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/FXLVSDojA1AJ.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



Re: [google-appengine] Projection Queries does not work with order() and Limit parameter

2012-06-19 Thread Alfred Fuller
what's your app id?

On Tue, Jun 19, 2012 at 7:59 PM, Christopher Ramírez 
blindedbythed...@gmail.com wrote:

 Hello Tim!

 I checked your the points.

   the missing records have values for the properties specified in the
 projection.

 Yes, they have. I just even updated them in the datastore admin
 (production) and still don't appear.

  an index that hasn't been rebuilt

 I ran appcfg.py update_indexed and the problem still persists.

 Another problem is that I'm specifing a limit of 20 records, but the
 projection query return me only 10 records. Actually, total existing
 instances are 20

 I just added a few more records. The new ones appear without trouble.
 Missing records seems to be the ones saved before the projection index was
 created.

 On Tuesday, June 19, 2012 7:11:50 PM UTC-6, timh wrote:

 I haven't used projections in queries, but I was just reading the docs
 and noted the following about indexes.

 projection List or tuple of names of properties to return. Only entities
 possessing the specified properties will be returned. If not specified,
 entire entities are returned by default. Projection 
 querieshttps://developers.google.com/appengine/docs/python/datastore/queries#Projection_Queries
  are
 faster and cheaper than those that return complete entitites.

 *Note:* Specifying this parameter may change the query's index
 requirements.
 Maybe you have added the projection arg and are encountering an index
 that hasn't been rebuilt.  That could be one explanation.
 The other thing to check would be if the missing records have values for
 the properties specified in the projection.

 Rgds

 T

 On Tuesday, June 19, 2012 10:35:32 PM UTC+8, Christopher Ramírez wrote:

 Yes it happens on both servers.

 On Monday, June 18, 2012 11:01:08 AM UTC-6, Alfred Fuller wrote:

 Does this happen in both the dev_appserver and production?

 On Fri, Jun 15, 2012 at 10:28 AM, Christopher Ramírez 
 blindedbythed...@gmail.com wrote:

 I was trying to use projection queries, but I had extrange issues
 using them.

 I'm trying to use them like this:
 offset_group = Clients.all( \
 projection=('name', 'sex', 'birth_date', 'email', 'discount')
 ).order('-__key__').fetch(**limit=10, offset=skip_recs)

 The above code is supposed to bring me the last 10 clients. But
 actually it does not return the last 10 (actually returns fewer and the
 actual last record is not included). Also the results seems alternated or
 maybe even/odd are skipped. If I take off projection param, the result is
 as spected:
 offset_group = Clients.all().order('-__key__'**).fetch(limit=10,
 offset=skip_recs)

 I do not know if this is a bug in projection queries or they have to
 be used in a different way. Please help me. I would like to use projection
 queries because they are really fast!

 Kind Regards,
 Christopher Ramírez

 --
 You received this message because you are subscribed to the Google
 Groups Google App Engine group.
 To view this discussion on the web visit https://groups.google.com/d/*
 *msg/google-appengine/-/Ahgw_**iP_mukJhttps://groups.google.com/d/msg/google-appengine/-/Ahgw_iP_mukJ
 .
 To post to this group, send email to google-appengine@googlegroups.**
 com google-appengine@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine+unsubscribe@**googlegroups.comgoogle-appengine%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at http://groups.google.com/**
 group/google-appengine?hl=enhttp://groups.google.com/group/google-appengine?hl=en
 .


  --
 You received this message because you are subscribed to the Google Groups
 Google App Engine group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-appengine/-/FXLVSDojA1AJ.

 To post to this group, send email to google-appengine@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-appengine?hl=en.


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



[google-appengine] Projection Queries does not work with order() and Limit parameter

2012-06-18 Thread Christopher Ramírez
I was trying to use projection queries, but I had extrange issues using 
them.

I'm trying to use them like this:
offset_group = Clients.all( \
projection=('name', 'sex', 'birth_date', 'email', 'discount')
).order('-__key__').fetch(limit=10, offset=skip_recs)

The above code is supposed to bring me the last 10 clients. But actually it 
does not return the last 10 (actually returns fewer and the actual last 
record is not included). Also the results seems alternated or maybe 
even/odd are skipped. If I take off projection param, the result is as 
spected:
offset_group = Clients.all().order('-__key__').fetch(limit=10, 
offset=skip_recs)

I do not know if this is a bug in projection queries or they have to be 
used in a different way. Please help me. I would like to use projection 
queries because they are really fast!

Kind Regards,
Christopher Ramírez

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/Ahgw_iP_mukJ.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



Re: [google-appengine] Projection Queries does not work with order() and Limit parameter

2012-06-18 Thread Alfred Fuller
Does this happen in both the dev_appserver and production?

On Fri, Jun 15, 2012 at 10:28 AM, Christopher Ramírez 
blindedbythed...@gmail.com wrote:

 I was trying to use projection queries, but I had extrange issues using
 them.

 I'm trying to use them like this:
 offset_group = Clients.all( \
 projection=('name', 'sex', 'birth_date', 'email', 'discount')
 ).order('-__key__').fetch(limit=10, offset=skip_recs)

 The above code is supposed to bring me the last 10 clients. But actually
 it does not return the last 10 (actually returns fewer and the actual last
 record is not included). Also the results seems alternated or maybe
 even/odd are skipped. If I take off projection param, the result is as
 spected:
 offset_group = Clients.all().order('-__key__').fetch(limit=10,
 offset=skip_recs)

 I do not know if this is a bug in projection queries or they have to be
 used in a different way. Please help me. I would like to use projection
 queries because they are really fast!

 Kind Regards,
 Christopher Ramírez

 --
 You received this message because you are subscribed to the Google Groups
 Google App Engine group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-appengine/-/Ahgw_iP_mukJ.
 To post to this group, send email to google-appengine@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-appengine?hl=en.


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



[google-appengine] Geopt queries (will this work?)...

2012-01-18 Thread mattmoore
Very basic query I want to run on a GeoPt property.


Basically I'm storing an entity with a GeoPt property and would like
users to be able to retrieve entities that have a value in said GeoPt
property within a bounding box from a given GeoPt.

Simple example of this would be a list of Restaurant entities that a
user could query and retrieve a list of Restaurant entities within 1km
of their current location.

I'm familiar with the concept of Geohashing http://en.wikipedia.org/wiki/Geohash
and have seen the 24 hours in San Fran sample that uses a different
technique http://code.google.com/appengine/articles/geosearch.html.

I'm also familiar with the fact that only one property in a GAE
Datastore query can have an inequality filter applied to it but can I
apply multiple filters to one property?

Is the following query valid?

SELECT *
FROM Restaurant
WHERE Restaurant.Location.Lattitude  (user_lat - d) AND
Restaurant.Location.Lattitude  (user_lat + d) AND
Restaurant.Location.Longitude  (user_lon - d) AND
Restaurant.Location.Longitude   (user_lon + d);

This example is similar to the example of a query that won't work in
GAE that I saw on the 24 hours in San Fran sample but why can't it
work?

I'm only running inequality on one property - Restaurant.Location.
Does Restaurant.Location.Latitude count as one property?

Thanks for you help in advance,

Matt

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



[google-appengine] Re: Queries that cannot be cursored?

2011-12-12 Thread Jason Collins
IN (and NOT_EQUALS) result in MultiQuery which doesn't support cursors
as far as I know.
j

On Dec 11, 7:21 pm, Jeff Schnitzer j...@infohazard.org wrote:
 Are there some kinds of queries for which cursors cannot be generated?

 I'm on Java SDK 1.6.0, using the advanced queries that let us escape
 exploding indexes.  Whenever I request a Cursor, I get back null from
 the low level QueryResultIterator.  When I click through to the GAE
 SDK source code it looks like the query class is some sort of
 UncompileableQuery which always returns null from getCursor().  Is
 this expected?  Will it change in the future?

 FWIW, my query is this:

 QueryClub query = ofy.load().type(Club.class)
                 .filter(cells in, cells)
                 .order(HasWords.SORT_FIELD)
                 .limit(CLUBS_BATCH_SIZE);

 (cells is a geocells multi-property)

 Thanks,
 Jeff

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



Re: [google-appengine] Re: Queries that cannot be cursored?

2011-12-12 Thread Jeff Schnitzer
Ah, and there it is documented in the Query docs.  However, it would
be very handy if this threw an exception rather than returning null.
Unfortunately, passing in a null Cursor in the fetch options works
just fine - so what happens is that rather than getting an exception
with an explanation of what you are doing wrong, the next query just
continues from the beginning and you get a loop.  Oops.

Thanks,
Jeff

On Mon, Dec 12, 2011 at 2:16 PM, Jason Collins
jason.a.coll...@gmail.com wrote:
 IN (and NOT_EQUALS) result in MultiQuery which doesn't support cursors
 as far as I know.
 j

 On Dec 11, 7:21 pm, Jeff Schnitzer j...@infohazard.org wrote:
 Are there some kinds of queries for which cursors cannot be generated?

 I'm on Java SDK 1.6.0, using the advanced queries that let us escape
 exploding indexes.  Whenever I request a Cursor, I get back null from
 the low level QueryResultIterator.  When I click through to the GAE
 SDK source code it looks like the query class is some sort of
 UncompileableQuery which always returns null from getCursor().  Is
 this expected?  Will it change in the future?

 FWIW, my query is this:

 QueryClub query = ofy.load().type(Club.class)
                 .filter(cells in, cells)
                 .order(HasWords.SORT_FIELD)
                 .limit(CLUBS_BATCH_SIZE);

 (cells is a geocells multi-property)

 Thanks,
 Jeff

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




-- 
We are the 20%

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



[google-appengine] Ancestor queries / indexes

2011-11-14 Thread johnP
My data currently on MS is organized into entities.
  - For example, let's say that each Organization is it's own entity
group.

Most of my queries are within an entity/organization.  An example of a
typical query is:
 - Employee.all().filter('organization =', org).filter('position =',
manager).fetch(1000)

This same query can also be done using an ancestor query:
 - Employee.all().ancestor(org_key).filter('position =',
manager).fetch(1000)

The first version of the query does not require a custom index, but
the second version does.

My questions:
1.  Will moving from the first version to the the second version of
the query require adding custom indexes? Or am I missing something?
2.  Clarification on Strong Consistency in HR:  Is it necessary to use
the ancestor() operator, or is simply querying within an entity group
strongly consistent?  My assumption has been that for queries that
must be strongly consistent, it will be necessary to migrate from the
first format to the second format (increasing the number of custom
indexes I need to carry).  Is this assumption correct?

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



[google-appengine] Running queries on data already stored in datastore

2011-11-14 Thread Zak
Hello all,

This is my first time using google app engine and the datastore so
this is all still pretty new to me. But I have successfully (using the
bulk loader tool) loaded my data from csv files into the datastore. I
am writing my program in Python and have now run into the issue of
retrieving data from the datastore using python. I understand how to
create Classes using db.Model in python, load information into them,
store them and then run queries on them. But how do you run quries on
the data that is stored in the datastore already?  When I run a query
for a Kind that I know is in my datastore it says Kind not found. Do I
still need to define a class (db.Model) to hold the data? If so, how
do I transfer the data from the datastore into my class object?

Any clarification would be much appreciated!

Zak

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



[google-appengine] contains() queries with bound variables

2011-04-15 Thread LemonTree
Hi everybody,

I have started experimenting with AppEngine and I have a quick
question.

I wrote a simple model where documents are arranged in spaces

@PersistenceCapable
public class Space
{
  @PrimaryKey
  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  private String id;

  @Persistent(mappedBy = space)
  private ListDocument documents;
  ...
}

@PersistenceCapable
public class Document
{
  @PrimaryKey
  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  @Extension(vendorName = datanucleus, key = gae.encoded-pk, value
= true)
  private String id;

  @Persistent
  @Extension(vendorName = datanucleus, key = gae.pk-name, value =
true)
  private String name;

  @Persistent
  private String author;
  ...
}

After populating the store with some documents in different spaces
created by several authors, I tried to formalise a query that gives me
all the spaces that contain a document created by a given author.

I wrote it like this:

select from mypackage.Space where documents.contains(d)  d.author ==
'foo' variables mypackage.Document d

The query is executed without errors but no results are returned.

What am I missing here? Any hint about what should I modify to get
this query work correctly?

Thanks,
F.

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



[google-appengine] Major queries problem using custom indexes

2010-08-11 Thread Zarko
Hi GAE team,

To my surprise, yesterday I suddenly started to get a single entity
result (most of the time), for 4 queries which resulted with all
entities of a specific kind in
the past

Nothing has changed in my code, and I confirmed that it work well in
the local SDK server + all entities are accounted for in the online
Datastore.
Furthermore, I vacuumed the 4 indexes and uploaded them again.
No effect...

Today I have done a reput of all entities (with MapReduce)
No effect...
Then, deleted all data (in beta) + vacuumed all indexes + rebuilt
them.
After indexes started serving, I have inserted some new entities from
scratch.
AND sometimes I see all of the data and sometimes I don't (for the
same query).

I think there is a major inconsistency bug with custom indexes
Please advice !

Zarko

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



Re: [google-appengine] Major queries problem using custom indexes

2010-08-11 Thread Nick Johnson (Google)
Hi Zarko,

Can you please supply your app ID, along with the queries that cause
problems (and the corresponding queries that function correctly)?

-Nick Johnson

On Wed, Aug 11, 2010 at 4:15 PM, Zarko eladza...@gmail.com wrote:

 Hi GAE team,

 To my surprise, yesterday I suddenly started to get a single entity
 result (most of the time), for 4 queries which resulted with all
 entities of a specific kind in
 the past

 Nothing has changed in my code, and I confirmed that it work well in
 the local SDK server + all entities are accounted for in the online
 Datastore.
 Furthermore, I vacuumed the 4 indexes and uploaded them again.
 No effect...

 Today I have done a reput of all entities (with MapReduce)
 No effect...
 Then, deleted all data (in beta) + vacuumed all indexes + rebuilt
 them.
 After indexes started serving, I have inserted some new entities from
 scratch.
 AND sometimes I see all of the data and sometimes I don't (for the
 same query).

 I think there is a major inconsistency bug with custom indexes
 Please advice !

 Zarko

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




-- 
Nick Johnson, Developer Programs Engineer, App Engine Google Ireland Ltd. ::
Registered in Dublin, Ireland, Registration Number: 368047
Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number:
368047

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



[google-appengine] Multiple queries or fetch all in one shot?

2010-06-19 Thread coltsith
In my game server, I let the user browse the open games. They can
choose to filter them, or not put any filters at all.

My question is, what's the best way to load the games from the
datastore. Let's say there's like 20,000.

Should I fetch them all in 1 query (no more 1000 limit) or fetch in
increments of like 2000 each and combine them into a big list?

Thanks

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



[google-appengine] Wildcard queries

2010-03-29 Thread PoulS
Apparently the datastore doesn't support wildcard queries. As long as
the query just has a trailing %, I suppose you could emulate them with
combined = and  filters, but what would you specify for the 
filter ?

As an aside, I'm rather puzzled by the limitations of the query
language, compared with SQL. Are there any resources explaining these
limitations and pssible workarounds..?

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



Re: [google-appengine] Wildcard queries

2010-03-29 Thread Ulrich

PoulS wrote:

Apparently the datastore doesn't support wildcard queries. As long as
the query just has a trailing %, I suppose you could emulate them with
combined = and  filters, but what would you specify for the 
filter ?
  

Let's say you have a search string like
search = u'abc'
I can think of two ways to do this:
= search AND  search + u'\U0010'
which will not work if one of your matches begins with
   search+u'\U0010'
but that is very unlikely...

And the other solution is
= search AND  search[:-1] + unichr(ord(search[-1])+1)

-Ulrich


As an aside, I'm rather puzzled by the limitations of the query
language, compared with SQL. Are there any resources explaining these
limitations and pssible workarounds..?

  


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



Re: [google-appengine] Wildcard queries

2010-03-29 Thread Robert Kluin

Google has provided a nice set of articles about the datastore:
http://code.google.com/appengine/articles/datastore/overview.html

Robert



On Mar 29, 2010, at 5:35, Ulrich mierendo...@googlemail.com wrote:


PoulS wrote:

Apparently the datastore doesn't support wildcard queries. As long as
the query just has a trailing %, I suppose you could emulate them  
with

combined = and  filters, but what would you specify for the 
filter ?


Let's say you have a search string like
search = u'abc'
I can think of two ways to do this:
= search AND  search + u'\U0010'
which will not work if one of your matches begins with
  search+u'\U0010'
but that is very unlikely...

And the other solution is
= search AND  search[:-1] + unichr(ord(search[-1])+1)

-Ulrich


As an aside, I'm rather puzzled by the limitations of the query
language, compared with SQL. Are there any resources explaining these
limitations and pssible workarounds..?




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




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



Re: [google-appengine] LIKE queries in java / Text searching

2010-02-17 Thread Ikai L (Google)
You can break the searchable text into tokens and store them also as in a
String List. This will make them indexed on save. Note that this can
potentially cause datastore puts to become much more expensive, as indexes
are updated synchronously.

Can you post the link to fake a prefix match in Python? There's likely a
Java analog.

On Wed, Feb 10, 2010 at 1:58 AM, tf tonydfor...@gmail.com wrote:

 Hi

 I want to query the datastore using a search string entered by the
 user, which may or may not be the full string value in the datastore.
 So I need functionality similar to LIKE queries in relational
 databases. My understanding from seeing other posts and the google
 documentation is that query filters do not have an explicit way to
 match just part of a string value. I have seen the workaround to fake
 a prefix match using Python.

 Has anyone doe some workaround for Java? Or is there another way to do
 what is essentially searching?

 Thx
 tony

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




-- 
Ikai Lan
Developer Programs Engineer, Google App Engine
http://googleappengine.blogspot.com | http://twitter.com/app_engine

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



[google-appengine] LIKE queries in java / Text searching

2010-02-10 Thread tf
Hi

I want to query the datastore using a search string entered by the
user, which may or may not be the full string value in the datastore.
So I need functionality similar to LIKE queries in relational
databases. My understanding from seeing other posts and the google
documentation is that query filters do not have an explicit way to
match just part of a string value. I have seen the workaround to fake
a prefix match using Python.

Has anyone doe some workaround for Java? Or is there another way to do
what is essentially searching?

Thx
tony

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



[google-appengine] Ancestor Queries...

2010-01-27 Thread Patrick Twohig
I've got a snippet of code that looks something like this

public  getSubEntities(Transaction transaction, Key parent) {
com.google.appengine.api.datastore.Query query;
com.google.appengine.api.datastore.PreparedQuery pquery;

MapKey, Entity  out = new HashMapKey, Entity();

query = new
com.google.appengine.api.datastore.Query().setAncestor(parent);
pquery = datastore.prepare(transaction, query);

for (Entity e : pquery.asQueryResultIterable()) {
out.put(e.getKey(), e);
}

return out;
}

...but when I run it, it never finds any sub entities of the given key.  I'm
guessing I'm missing somthing?  I'm trying to find all the direct
sub-entities of the given entity key.  I've checked that they're in the
datastore, but for whatever reason the loop never hits.  Any suggestions?  I
haven't tried this in the app engine, just the local data store.


-- 
Patrick H. Twohig.

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

Office: 619.862.2890 x100
Cell: 619.453.5075
Twitter: @svm_invictvs
IRC: svm_invic...@irc.freenode.net ##java, #android-dev, #iphonedev,
#appengine

http://www.namazustudios.com/

This communication, and any attachments, shall be considered confidential
and proprietary information of Namazu Studios LLC.  This message, and
attachments, are intended for the listed recipients only.  If you are not
one of the intended recipients, please destroy all copies of this
communication.

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



Re: [google-appengine] Date queries from the admin console data explorer

2010-01-10 Thread djidjadji
http://code.google.com/appengine/docs/python/datastore/gqlreference.html

2010/1/5 Grant grant.klop...@gmail.com:
 Hi

 Wonder if anyone can help me with this...

 How do I do a query against a date from the admin console data
 explorer. I know how to do it from Java/Python, but am unable to
 phrase it correctly from the explorer.

 Doing something like this simply returns no results and leaving out
 the quotes results in an error...

 SELECT * FROM Content where date = '2009-12-03'

 Once again, this is a query in the data explorer in the admin console,
 not in Java/Python program

 Thanks

 --

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



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




[google-appengine] Date queries from the admin console data explorer

2010-01-05 Thread Grant
Hi

Wonder if anyone can help me with this...

How do I do a query against a date from the admin console data
explorer. I know how to do it from Java/Python, but am unable to
phrase it correctly from the explorer.

Doing something like this simply returns no results and leaving out
the quotes results in an error...

SELECT * FROM Content where date = '2009-12-03'

Once again, this is a query in the data explorer in the admin console,
not in Java/Python program

Thanks

--

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




[google-appengine] IN queries

2009-09-04 Thread Jeff Enderwick

I read somewhere that IN queries are processed serially by the
datastore. GOOGers, what is a rough rule-of-thumb on the benefit of
using IN? For example, if the base RT latency for anything with the
datastore is Nms, then could guesstimate that using N for a list of 3
is not a huge latency win, but using IN for 10 is. Does using IN
substantially cut down on the api_cpu_ms used vs sequential queries?

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



[google-appengine] Datastore queries fail after adding searchable text index

2009-06-04 Thread John Tantalo

My datastore is currently refusing all queries for one of my entities
after I added a new __searchable_text_index for the entity. The model
is an instance of search.SearchableModel and I have had other
searchable text indexes for this entity.

As a result, any query except select * fails and returns 0 results,
even queries with existing indexes. My index list shows all indexes as
serving.

Any idea what could cause this? How to fix it? Should I try to kill
the new index?

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