[Zope-dev] [Fwd: ZCatalog.. Again.. I know..]
Chris Withers
chrisw@nipltd.com
Wed, 24 May 2000 20:39:22 +0100
Michel Pelletier wrote:
>
> I'm looking into this right now...
>
Many thanks :-)
As you may have gathered from my posts, I've been having a bit of a
ZCatalog/SiteAccess (not to mention MIME) nightmare today...
...I took a day off work to try and get Squishdot 0.4.0 out and have
spent the day tryign to figure out whether or not it's my that that's
$"£$ed
All I'd like to know is:
Is ZCatalog in 2.1.6 likely to return incorrect search results, or is it
my python code that's broken?
In either case, how do I fix it? ;-)
cheers,
Chris
PS: My code, that may be broken... data is an IOBTree for id-->Posting
objects. Could there be any untoward aquisition going on here? Posting
acquires from Implicit.
def recatalogPostings(self,REQUEST=None):
""" Clear the Catalog and then Index all the postings. """
self._catalog.clear()
for id in self.data.keys():
obj = self.data[id]
self.catalog_object(obj,self.absolute_url(1)+
obj.thread_path()+ '/' + `id`)
return self.manage_postings(self, REQUEST)
The index which is causing the problem is 'textToSearch' which is
supplied by the following function:
def textToSearch(self):
"""# returns the text to search for a ZCatalog"""
text=''
for line in self.summary:
# strip out HTML and append a newline to each line.
text = text+tagRegex.sub("",line)+'\n'
for line in self.body:
# strip out HTML and append a newline to each line.
text = text+tagRegex.sub("",line)+'\n'
return text