ZCatalog Lazy Results
Hi, I need to check an assumption I have made on the ZCatalog Brains and Lazy Results from reading the source. 1. The Brains gets its schema from the ZCatalog and this schema is basicly fixed. E.g. a search result always has the attributes defined by the Meta Data in the ZCatalog? I would rather be able to construct a Brain Schema at search time equivalent to the way theSELECT statement sets up the result attributes in SQL. Example: resultset = Catalog.searchResults(query,schema=('id','title','keywords')) 2. The laziness of the ZCatalog search result means it's batched? Regards, Johan Carlsson torped johan carlsson birkagatan 9 113 36 stockholm johanc@torped.se www.torped.se voice +46-(0)-8-32 31 23 mobil +46-(0)-70-558 25 24 workshop västmannagatan 67
--- Johan Carlsson <johanc@torped.se> wrote:
Hi, I need to check an assumption I have made on the ZCatalog Brains and Lazy Results from reading the source.
1. The Brains gets its schema from the ZCatalog and this schema is basicly fixed. E.g. a search result always has the attributes defined by the Meta Data in the ZCatalog?
Yes, you always get all the meta-data. However, does anyone know how the "used" argument of ZCatalog.searchResults works, or why you would use it?
I would rather be able to construct a Brain Schema at search time equivalent to the way theSELECT statement sets up the result attributes in SQL. Example: resultset =
Catalog.searchResults(query,schema=('id','title','keywords')) Why is this important? I would suggest not putting big stuff in the meta-data that might warrant this. Just use the nifty new (v2.3) getObject method of the brain to access whatever properties/methods of the actual object you might need.
2. The laziness of the ZCatalog search result means it's batched?
Lazy sequences work by not loading the result items in memory until they are actually accessed.
Regards, Johan Carlsson
===== | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `-----------------> __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/
I would rather be able to construct a Brain Schema at search time equivalent to the way theSELECT statement sets up the result attributes in SQL. Example: resultset = Catalog.searchResults(query,schema=('id','title','keywords'))
Why is this important? I would suggest not putting big stuff in the meta-data that might warrant this. Just use the nifty new (v2.3) getObject method of the brain to access whatever properties/methods of the actual object you might need.
If I have allot of MetaDatas and do allot of searches, one for each page hit, I assume it would use up allot of memory and do allot of copying of attributes? I want to use ZCatalog for dynamic linking.
2. The laziness of the ZCatalog search result means it's batched? Lazy sequences work by not loading the result items in memory until they are actually accessed.
Ok, suppose I should have known that. Thanks. Johan
participants (2)
-
Casey Duncan -
Johan Carlsson