[Zope] ZCatalog Related Questions

James W. Howe jwh@allencreek.com
Thu, 03 Feb 2000 11:23:20 -0500


At 10:13 AM 2/3/00 -0600, Evan Simpson wrote:
>----- Original Message -----
>From: James W. Howe <jwh@allencreek.com>
> > 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.
>
>I think that a good way to handle this would be to give your Article ZClass
>a 'PrincipiaSearchSource' method.  This method would read and return the
>contents which you want indexed.  One side benefit of this is that you can
>pre-process the contents to remove/replace stuff which you don't want in
>your index.
>
>PrincipiaSearchSource is the default method used to populate TextIndexes
>(IIRC).

I just started looking into PrincipiaSearchSource.  I've seen it mentioned 
but I never knew what is was used for.  Can you give me a little more 
information on how I might use this?  Suppose, for example, that instances 
of my Article ZClass always have a DTMLMethod called 'article_content'.  I 
want to catalog this information but always in the context of the Article 
object.  For example, if the article_content contained the string "Zope", I 
would want to be able to do a full text search and have the Catalog return 
an Article instance which had "Zope" in the text of its "article_content" 
DTMLMethod.  If I wanted to index this stuff, would I just define a 
PrincipiaSearchSource method which returned the (possibly massaged) 
contents of the "article_content" method?  When I did a catalog search, 
would I just ask for items which had a meta_type of 'Article' and a 
PricipiaSearchSource which contained the string I was looking for?

Thanks for your help.

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