[google-appengine] Re: How do I limit searchable_text_index using SearchableModel?

2009-06-29 Thread twansc...@googlemail.com
On 10 Jun., 11:11, ogterran jonathanh...@gmail.com wrote: Hi, When I create a datastore model using SearchableModel, it creates a __searchable_text_index column, for full textsearch. If I don't want all the columns to be part of the index forsearch, how do I exclude columns for full

[google-appengine] Re: How do I limit searchable_text_index using SearchableModel?

2009-06-25 Thread ogterran
Worked great Nick. Thanks for all your help On Jun 24, 3:27 am, Nick Johnson (Google) nick.john...@google.com wrote: Hi ogterran, You'll need to define a custom handle_entity function for your loader class. This function can return multiple ProductIndex entities in addition to the Product

[google-appengine] Re: How do I limit searchable_text_index using SearchableModel?

2009-06-24 Thread ogterran
Thanks for all the responses. I'll use Ian's first suggestion on Product, ProductIndex until key_only query issue is resolved. How do I change my bulkloader to update the Product and ProductIndex on one upload? class ProductLoader(bulkloader.Loader): def __init__(self):

[google-appengine] Re: How do I limit searchable_text_index using SearchableModel?

2009-06-24 Thread Nick Johnson (Google)
Hi ogterran, You'll need to define a custom handle_entity function for your loader class. This function can return multiple ProductIndex entities in addition to the Product entity being loaded. See the docstring for details:

[google-appengine] Re: How do I limit searchable_text_index using SearchableModel?

2009-06-23 Thread ogterran
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 =

[google-appengine] Re: How do I limit searchable_text_index using SearchableModel?

2009-06-23 Thread Nick Johnson (Google)
Hi ogterran, On Tue, Jun 23, 2009 at 9:59 AM, ogterran jonathanh...@gmail.com 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 =

[google-appengine] Re: How do I limit searchable_text_index using SearchableModel?

2009-06-23 Thread Ian Lewis
ogterran, It should do one for the search and then one for each item in the search result. 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

[google-appengine] Re: How do I limit searchable_text_index using SearchableModel?

2009-06-23 Thread Ian Lewis
Nick, But he is also doing v.product which will do a get() by key for each Product entity will it not? On Tue, Jun 23, 2009 at 7:14 PM, Nick Johnson (Google) nick.john...@google.com wrote: Hi ogterran, On Tue, Jun 23, 2009 at 9:59 AM, ogterran jonathanh...@gmail.com wrote: Hi Ian,

[google-appengine] Re: How do I limit searchable_text_index using SearchableModel?

2009-06-23 Thread Nick Johnson (Google)
2009/6/23 Ian Lewis ianmle...@gmail.com 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

[google-appengine] Re: How do I limit searchable_text_index using SearchableModel?

2009-06-23 Thread acuth
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

[google-appengine] Re: How do I limit searchable_text_index using SearchableModel?

2009-06-23 Thread Nick Johnson (Google)
You're quite right. This will be fixed in a future release. -Nick Johnson 2009/6/23 acuth adrian.cuthb...@gmail.com 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

[google-appengine] Re: How do I limit searchable_text_index using SearchableModel?

2009-06-23 Thread Ian Lewis
Argh, I didn't test it to make sure it actually worked. Is there a bug I can star for this issue? 2009/6/23 Nick Johnson (Google) nick.john...@google.com You're quite right. This will be fixed in a future release. -Nick Johnson 2009/6/23 acuth adrian.cuthb...@gmail.com Whenever I've

[google-appengine] Re: How do I limit searchable_text_index using SearchableModel?

2009-06-10 Thread Ian Lewis
ogterran, Unfortunately the SearchableModel indexes all StringProperties and TextProperties in the model. You will need to create another model that contains only the items you want to index. Something like: class Product(db.Model): pid = db.StringProperty(required=True) title =