[Zope] regexp - searching documents under a folder tree.

Michel Pelletier michel@digicool.com
Tue, 6 Apr 1999 11:58:06 -0400


> -----Original Message-----
> From: Timothy Cole [mailto:Timothy.Cole@kellogg.com]
> Sent: Tuesday, April 06, 1999 11:35 AM
> To: zope@zope.org
> Subject: [Zope] regexp - searching documents under a folder tree.
> 
> 
> 
> 
> All,
> 
> Does anyone know of any methods which exist for searching either
> a document's title or contents recursively under a Folder tree?
> 
Uhm... define contents.  This is the killer question.  Do you want your
methods rendered? unrendered?  does it make any sense to search DTML,
does it make any sense to search out of context rendered DTML?

The Zope indexing machinery comes with 1.10.2, but it is fairly low
level, you'll have to create a whole cataloging product that whizes
through your objects indexing their 'contents' and attributes.  You
would have to write it yourself.  We have a Cataloging product that does
*exactly this*.  It is not open source, and you will need to contact
Paul (paul@digicool.com) to make some sort of arrangement (usually $$$)
to get it.

Optionally you can recursively search through your objects, but this
could take a bit more time than using an index.  If your tree is small,
you can use objectItem or objectValues (see
lib/python/OFS/ObjectManager.py) methods to get a list of all sub-items
in a folder, and then iterate over all of them looking for a criteria
match, recursivly descending into folderoid object.

> Something along the lines of a regexp search would be great.
> 

This could be used to 'match' your criteria when you iterate over a
folder objects.

-Michel

> Any suggestions before I attempt to conquer my first external 
> method :)
> 
> Cheers,
> -Tim
> 
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://www.zope.org/mailman/listinfo/zope
> 
> (For developer-specific issues, use the companion list,
> zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
>