From: "Casey Duncan" <casey@zope.com>
On Mon, 21 Jun 2004 09:49:00 -0400 "Small Business Services" <toolkit@magma.ca> wrote:
Hi Casey,
I am trying to implement your suggestion of accessing the '_docwords' structure in an attempt to eliminate duplicate storage of data in the ZCatalog.
I have created a test external method to retrieve the _docwords entry for a specific object in an existing ZCatalog:
def jtmp(self): res = self.Catalog({'id' : '1086793690.85'}) for item in res: rid = item.data_record_id_ return self.Catalog.getIndex('all_searchable_text').getEntryForObject(rid)
Catalog is a ZCatalog instance, (not a Catalog instance) so it doesn't have getIndex. One of these two should work:
idx = self.Catalog.Indexes['all_searchable_text']
or
idx = self.Catalog._catalog.getIndex('all_searchable_text')
Thanks Casey! The second option solved the problem: return self.Catalog._catalog.getIndex('all_searchable_text').getEntryForObject(rid) Works like a charm! Jonathan