[Zope-dev] CatalogAware

Christopher Petrilli petrilli@digicool.com
Fri, 05 Jan 2001 11:32:30 -0500


On 1/5/01 7:16 AM, "Chris Withers" <chrisw@nipltd.com> wrote:

>> uncatalog_object to be called on it (I'm not sure what
>> method reindex_object causes to be called).
> 
> unindex_object followed by index_object. I'm not convinced it's
> necessary, as no-one has said that uncataloging is a necessary step
> before catalogng something that's already in the catalog.

Actually this is where the luminous KeyError lurks.  If you don't
unindex_object first (prior to 2.2.4), then you could potentially have words
in the forward index that your object no longer contains, and eventually it
could get into a state where you get a KeyError.

In 2.2.4 I modified it (rather bluntly) to always do an unindex_object
before even starting the index_object proceedings... This is obviously
rather heavy, but it did prevent a lot of faulty uses... CatalogAware was
wrong, for example :-)

In 2.3a2 (hopefully :-) and if not a3), Jim and I have developed some
merging code that will do much more intelligent merging of new and old data,
reducing the size of transactions in the Catalog, and also preventing things
from being touched when in fact nothing changed---this can be responsible
for 70-80% of the bloat in some sites.

In addition, many needless objects were touched when they had no relevance
to the object being indexed.  This should also help reduce bloat.  Speed, so
far is on par, and eventually we hope faster for most sites.

Chris
-- 
| Christopher Petrilli                                     Digital Creations
| petrilli@digicool.com                                Where Zope comes from