Re: [Zope-dev] ZCatalog Lazy Results

2001-02-22 Thread Johan Carlsson

 Casey Duncan [EMAIL PROTECTED] wrote:
  
  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?
 
 'used' tells you the names of the indexes which actually
 participated in the search (as distinct from those you
 asked for).

What does this meen?

Example, What's the different between:

  searchResults(used=(index1,index2), index1='kalle', index2='kaviar')

and;

  searchResults(index1='kalle', index2='kaviar')


(Are used supposed to be a tuple?)

TIA,
Johan Carlsson


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] ZCatalog Lazy Results

2001-02-22 Thread Tres Seaver

On Thu, 22 Feb 2001, Johan Carlsson wrote:

  Casey Duncan [EMAIL PROTECTED] wrote:
   
   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?
  
  'used' tells you the names of the indexes which actually
  participated in the search (as distinct from those you
  asked for).
 
 What does this meen?
 
 Example, What's the different between:
 
   searchResults(used=(index1,index2), index1='kalle', index2='kaviar')
 
 and;
 
   searchResults(index1='kalle', index2='kaviar')

There is no practical difference, unless you are "federating"
queries across multiple catalogs;  the 'used' parameter is there
solely to accumulate a record of the indices used in the search.
 
 (Are used supposed to be a tuple?)

It should be something supporting the mapping interface.  Here is
how it is used (from 'lib/python/Products/ZCatalog/Catalog.py'):

  if used is None: used={}
  for i in self.indexes.keys():
  try:
  index = self.indexes[i].__of__(self)
  if hasattr(index,'_apply_index'):
  r=index._apply_index(args)
  if r is not None:
  r, u = r
  for name in u:
  used[name]=1

In other words, "Nothing to see here;  move along." :)

Tres.
-- 
===
Tres Seaver[EMAIL PROTECTED]
Digital Creations "Zope Dealers"   http://www.zope.org


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] ZCatalog Lazy Results

2001-02-22 Thread Dieter Maurer

Tres Seaver writes:
  'getObject' forces you to "wake up" the catalogued object;
  in a large enough result set, the price is pretty punitive,
  compared to serving the results as cached metadata.
You can batch large result sets: "getObject" would just be
applied to the objects in the batch.

The objects are cached, too (ZODB cache).



Dieter

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] ZCatalog Lazy Results

2001-02-20 Thread Casey Duncan

--- Johan Carlsson [EMAIL PROTECTED] 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.
| [EMAIL PROTECTED]
`-

__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] ZCatalog Lazy Results

2001-02-20 Thread Johan Carlsson

  
  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

—ƒzšŠYbh:)zŠ†ib3—j)fjŠb?Š^uh(t-j–+-mŠlŠ^?™™–+-Šw:)yzmŠlŠ^?™™–+-Šw:)


Re: [Zope-dev] ZCatalog Lazy Results

2001-02-20 Thread Johan Carlsson

 How many is "a lot" of meta datas?

At least 20-30.
Johan


 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
  
  

hf–Xš)x7Š^!X+ƒšŠYšŸb~—zhr,š,+3zw(v)EZeŠl†ib3—j)fjŠb?Š^jyw†ib3—j)fjŠb?Š^