[Zope] ZCatalog Related Questions

James W. Howe jwh@allencreek.com
Thu, 03 Feb 2000 09:46:55 -0500


I'm working on a site which manages news articles for a web 
publication.  Currently I have an Article ZClass which has some properties 
about the article.  In addition, Article is has ObjectManager 
behavior.  When an article is created, key properties of the object are 
defined and the article content itself is stored as a DTMLMethod within the 
Article.  So far this has worked fine.  However, I'm now looking into how I 
can add searching to my site.  I've played around a little bit with 
ZCatalogs but some things still puzzle me.

One of the things I would like to do is have a full text search of all my 
articles.  However, it seems that the way I've structured things would 
require me to index all my DTMLMethods, whether they were contained in an 
article folder or not.  I can't seem to tell the system that I want to 
catalog only the DTMLMethods which are contained inside objects with a 
meta_type of 'Article', for example.  It seems that to get the behavior 
that I want I should store the article content in a property of my Article 
ZClass.  Then, I could just index that property value and I would only get 
data from that property.  What other ways are there to do this sort of thing?

Another question I have concerns the difference between Catalog Indexes and 
Catalog Metadata.  From what I've read, it seems that items in Indexes are 
things you can specify in a search in order to find objects which have 
values corresponding to the index fields.  Metadata is information stored 
in the cataloged object itself and is immediately available rather than 
having to get the real object from the catalog object.  Is this 
correct?  If I wanted to do a full text search, do I just define one index 
field with a value of TextIndex?  How does the TextIndex get populated.  If 
I define a TextIndex and do a find of all 'Articles', what will end up in 
the TextIndex?

Finally, is it generally true that a web site would define one ZCatalog 
(typically named 'Catalog') which contains data from all the different 
items that I might want to have cataloged?  For example, I have Article 
data that I'm interested in and I have Issue data that I'm interested 
in.  They don't have the same set of properties.  Do I just define one 
ZCatalog and define indexes for all of the properties that I'm interested 
in from both objects?

I've read the information on ZCatalogs from zope.org but I still have 
questions.  Is there a place where I can see some additional examples of 
ZCatalog usage?

Thanks.

James W. Howe				mailto:jwh@allencreek.com
Allen Creek Software, Inc.		pgpkey: http://ic.net/~jwh/pgpkey.html		
Ann Arbor, MI  48103