[Zope] Puzzled re ZCatalog and Zope.org /SiteIndex

Jeff Rush Jeff Rush" <jrush@timecastle.net
Wed, 03 Nov 99 01:26:20 -0500


I'm trying to duplicate the search engine approach used on the Zope.org
site, find the /view_source a wonderful tool for poking about.

[1] Some areas I'm having trouble on are the metadata and index fields
used in DTML that accesses the SiteIndex zcatalog object.  They use
search fields like 'date', 'url', 'title_or_id' and 'text_content' which don't
exist in a default zcatalog instance.  I can add them via the management
interface and re-catalog the site but nothing ever shows up in those
index fields.  Is Zope.org using some pluggable-brain technology to
wrap a zcatalog and provide these attributes on normal, unchanged
objects like DTML Documents and DTML Methods?

[2] When I provide a searchForm (using Z Search wizard) that invokes
a search DTML method wherein I call searchResults(REQUEST=REQUEST),
it seems that searchResults() uses too much from REQUEST, pulling in
default/invalid values for fields that the user decided not to supply, say not
picking a meta_type from a drop-down list or leaving the date_usage value
to 'modified since ever'.  This causes searchResults() to return every item
in the zcatalog, since -every- item has been modified since 'ever'. ;-)

[3] I see in the Python source that I can invoke Python methods to
wrap/assign a pluggable-brain class to a catalog -- is there a way to
do this via DTML, or at least via the management interface so I can
define the brain to use when I initially create the catalog instance?

[4] The Zope.org site uses a sort_link() method in the SiteIndex
search method, but I cannot find it anyplace on Zope.org.  Is it an
external method I can't reach?  It seems a simple enough method
that constructs links on the column headings to allow a user to
re-sort the records on different columns.  It's worth a HOW-TO.

[5] There is also an icon_for_meta_type method in the SiteIndex
container that maps a meta_type string to the appropriate icon.
It uses an explicit if-then list for this however, meaning that when
new products are added to a site, their icons won't get picked
up.  To avoid the messiness of such, can we get a new method
added to the next Zope release that globally maps any meta_type
to whatever icon the management interface would use for that
type?  HE knows what icon to use, even for the OFSP product.

[6] When I catalog the DTML Documents/Methods on my site,
the textindex of the PrincipiaSearchSource value (the DTML
source) is difficult to use because it takes the DTML source
rather literally i.e. if I have <B>C++</B>, that is parsed and
indexed as a single word, so searches for "C++" won't find
it (at least that's what my tests seem to indicate).  I suppose
one solution is to define a PrincipiaSearchSource method
for my objects that somehow filters out the xTML and returns
just the raw text, but how can I do that for existing types like
DTML Document/Methods?

-Jeff Rush