Zope Version: 2.4.1 on linux.

When I tried to add a ZCatalog followed by finding objects to index using
the default indices provided (path, summary, id, title etc), the 'path' and
'summary' indices are never generated. The 'summary' index is always an
empty string and the 'path' index is 'None'.

To get around the 'summary' not being indexed for DTMLMethod and
DTMLDocument objects I had to add the following method to DTMLMethod.py:

    def summary(self):
        "Support for searching - the document's contents are searched."
        raw = self.read()
        stripped_raw = re.sub("<.*>", "", raw)
        n=min(200, len(stripped_raw))
        return stripped_raw[:n]

which basically strips out anything between '<' and '>' tags which should
strip most of the DTML and HTML tags out to give a half decent 200 character

Unfortunately I tried the same with the 'path' index by adding the following
to DTMLMethod.py

    def getPath(self):
         "Get path"
         return getPath(self)

    def path(self):
         "Get path"
         return join(self.getPhysicalPath(), "/")

but the 'path' index only works it is a FieldIndex. When it's a PathIndex I
get the value of None for all cataloged items.

Surely someone else has come across these problems before using this basic
catalog stuff??

Shane Rowatt
Astracon Inc.

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

Reply via email to