[google-appengine] Re: Alfred Fuller - "... So we've done that ..." : ZigZag merge join += Sort
...or is it to be superceded by the Full Text Search service they detailed at Google I/O 2011? http://www.youtube.com/watch?v=7B7FyU9wW8Y -- 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/-/WM5r_era98IJ. 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: Closure and Google App Engine
Just for the record... my initial post was just me wanting to explore using Closure as cheaply as possible. I certainly agree that one would expect to use the Closure Compiler for a production system. But I would have thought that the goog.provide ()/goog.require() mechanism in combination with minified files on a CDN would have been an acceptable model for developers exploring Closure for the first time. Currently everything I have that is publicly hosted is either on Blogger or GAE and I don't think either of those is a natural home for the Closure Library. --~--~-~--~~~---~--~~ 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: SearchableModel and the word 'done'
opps, didn't think of that. 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-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] SearchableModel and the word 'done'
It seems that SearchableModel has a problem with the word 'done'. The following code seems to find the word 'done' in all the TestItems import logging from google.appengine.ext import db from google.appengine.ext import search class TestItem(search.SearchableModel): name = db.StringProperty() class TestSuite(object): def newItem(self,name): item = TestItem() item.name = name item.put() def doTest(self): self.newItem('done item number one') self.newItem('what should I do today') self.newItem('hello world') self.newItem('it should be sunny today') logging.info('- search for items with the word "done"') for k in TestItem.all().search('done'): logging.info(k.name) logging.info('- search for items with the word "today"') for k in TestItem.all().search('today'): logging.info(k.name) INFO 2009-09-29 07:41:13,920 actest.py:26] - search for items with the word "done" INFO 2009-09-29 07:41:13,924 actest.py:28] done item number one INFO 2009-09-29 07:41:13,925 actest.py:28] what should I do today INFO 2009-09-29 07:41:13,925 actest.py:28] hello world INFO 2009-09-29 07:41:13,926 actest.py:28] it should be sunny today INFO 2009-09-29 07:41:13,926 actest.py:29] - search for items with the word "today" INFO 2009-09-29 07:41:13,931 actest.py:31] what should I do today INFO 2009-09-29 07:41:13,931 actest.py:31] it should be sunny today --~--~-~--~~~---~--~~ 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: How do I limit searchable_text_index using SearchableModel?
Whenever I've tried doing a SearchableModelDescendant.all (keys_only=True).search(query) construction, it has failed saying it doesn't understand the keys_only parameter - see 'Using __key__ and SearchableModel http://groups.google.com/group/google-appengine/browse_thread/thread/73dc1dc31bfd497b Do you know if this was fixed in a recent release? Adrian On Jun 23, 11:33 am, "Nick Johnson (Google)" wrote: > 2009/6/23 Ian Lewis > > > ogterran, > > > It should do one for the search and then one for each item in the search > > result. > > Not quite - it will do one _query_, and multiple gets. A get is much, much > cheaper than a query. You're right about the number of round-trips, though. > > > If you are worried performance on the calls to the datastore you can modify > > this code to make the ProductSearchIndex entity be a child of the Product > > entity and use a key only query to retrieve only the keys for the search > > index entities (since we only really care about the Products anyway). > > Good idea! > > > > > > > This will still to the same number of queries but will avoid the overhead > > of deserializing the ProductSearchIndex objects (and the associated index > > list property which might be long). > > > Something like the following should work: > > > class Product(db.Model): > >pid = db.StringProperty(required=True) > >title = db.StringProperty(required=True) > >site = db.StringProperty(required=True) > >url = db.LinkProperty(required=True) > > > class ProductSearchIndex(search.SearchableModel): > ># parent == Product > >title = db.StringProperty(required=True) > > > ... > > # where you write the Product > > product = Product(pid = pid, title=title, site=site, url=url) > > product.put() > > index = ProductSearchIndex(parent=product, title=title) > > index.put() > > > ... > > # where you search > > keys = ProductSearchIndex.all(keys_only=True).search(query).fetch(100) > > for key in keys: > > product = Product.get(key.parent()) > > print product.url > > This can be done much more efficiently: > keys = ProductSearchIndex.all(keys_only=True).search(query).fetch(100) > products = db.get(x.parent() for x in keys) > > Now you're down to just two round-trips! > > -Nick Johnson > > > > > > > On Tue, Jun 23, 2009 at 5:59 PM, ogterran wrote: > > >> Hi Ian, > > >> Thanks for the response. > >> I have one question on number of datastore calls. > >> How many datastore calls is the query below making? > >> Is it 1 or 100? > > >> > class Product(db.Model): > >> >pid = db.StringProperty(required=True) > >> >title = db.StringProperty(required=True) > >> >site = db.StringProperty(required=True) > >> >url = db.LinkProperty(required=True) > > >> > class ProductSearchIndex(search.SearchableModel): > >> >product = db.ReferenceProperty(Product) > >> >title = db.StringProperty(required=True) > > >> query = ProductSearchIndex.all().search(searchtext) > >> results = query.fetch(100) > >> for i, v in enumerate(results): > >>print v.product.url > > >> Thanks > >> Jon > > > -- > > === > > 株式会社ビープラウド イアン・ルイス > > 〒150-0012 > > 東京都渋谷区広尾1-11-2アイオス広尾ビル604 > > email: ianmle...@beproud.jp > > TEL:03-5795-2707 > > FAX:03-5795-2708 > >http://www.beproud.jp/ > > === > > -- > Nick Johnson, App Engine Developer Programs Engineer > 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-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: Using __key__ and SearchableModel
With the SearchableModel class you get a new method called search() that takes as a parameter the terms you are searching on. AFAIK there isn't a GQL construct that matches it. On Jun 12, 3:48 am, Antoniov wrote: > SELECT [* | __key__ ] FROM > [WHERE [AND ...]] > [ORDER BY [ASC | DESC] [, [ASC | DESC] ...]] > [LIMIT [,]] > [OFFSET ] > [HINT (ORDER_FIRST | HINT FILTER_FIRST | HINT ANCESTOR_FIRST)] > > Is this what you're looking for? > > On 6月12日, 上午7时09分, acuth wrote: > > > > > Hi everyone, > > > just caught up with one of those Google IO videos about developing > > apps on GAE. I was already using separated out index-blocks so that I > > could restrict what was indexed for SearchableModel. Now I just want > > to return the keys rather than the object themselves. > > > Does anybody know if it is possible to return just the keys - as per > > SELECT __KEY__ or Query(keys_only=True) - on queries/searches using > > the SearchableModel class, for example: > > > from google.appengine.ext import search > > > class ItemIB(search.SearchableModel): > > name = db.StringProperty() > > > > > # search for items with name that matches q, but returns entire > > ItemIB > > query = ItemIB.all().search(q) > > > # try replacing Model.all() with db.Query(Model) doesn't work > > query = db.Query(ItemIB,keys_only=True).search(q) > > > > > Any help very gratefully received, Adrian --~--~-~--~~~---~--~~ 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] Using __key__ and SearchableModel
Hi everyone, just caught up with one of those Google IO videos about developing apps on GAE. I was already using separated out index-blocks so that I could restrict what was indexed for SearchableModel. Now I just want to return the keys rather than the object themselves. Does anybody know if it is possible to return just the keys - as per SELECT __KEY__ or Query(keys_only=True) - on queries/searches using the SearchableModel class, for example: from google.appengine.ext import search class ItemIB(search.SearchableModel): name = db.StringProperty() # search for items with name that matches q, but returns entire ItemIB query = ItemIB.all().search(q) # try replacing Model.all() with db.Query(Model) doesn't work query = db.Query(ItemIB,keys_only=True).search(q) Any help very gratefully received, Adrian --~--~-~--~~~---~--~~ 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] Modeling mutual references
Is it possible to have two models reference each other? I can't get this to work and haven't been able to find this limitation in the documentation. As a simple example, consider: class Book(db.Model): title = db.StringProperty() first = db.ReferenceProperty(Page) class Page(db.Model): text = db.TextProperty() next = db.SelfReferenceProperty() book = db.ReferenceProperty(Book) which generates "NameError: name 'Page' is not defined" when processing the Book class definition. Is this really a limitation of the underlying data store or is it more related to how models are defined in Python? I'm guessing the solution is to record the 'first page in book' information as a separate class, for example: class FirstPage(db.Model): book = db.ReferenceProperty(Book) first = db.ReferenceProperty(Page) any pointers would be gratefully received, Adrian --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: Is there anyway of getting the dimensions of an image?
I now see that this specific issue has been raised as http://code.google.com/p/googleappengine/issues/detail?id=435 and that somebody was good enough to supply precisely the relevant code at http://groups.google.com/group/google-appengine/browse_thread/thread/cd287afcdf4cf976/388c5be1a22747fe?lnk=gst&q=image+width#388c5be1a22747fe --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Is there anyway of getting the dimensions of an image?
Hi, I want to generate a 20x20 image out of an uploaded image. Using the image API I can resize it to 20x20 but for non-square input images I get a smaller image. For example a 100x50 image would come back as a 20x10 image. The crop() method would allow me to extract a square image but to generate the input parameters - left_x=0.25, top_y=1.0, right_x=0.75, bottom_y=0.0 - I need to know the image dimensions. Any thoughts/advice would be gratefully received, Adrian --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: Is there anyway of getting the dimensions of an image?
I guess I had assumed that the Image API already had the necessary functionality and that I just hadn't found it yet. Obviously it's a very small subset of PIL functionality, which people have been asking for since issue 38 - http://code.google.com/p/googleappengine/issues/detail?id=38 --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---