[Zope-CMF] indexing again

Tres Seaver tseaver@zope.com
Wed, 17 Oct 2001 09:24:14 -0400


Florent Guillaume wrote:

> The reindexing of workflow-wrapped method is mainly a side-effect of the
> need to get the new review_state (and other worlkflow variables)
> reindexed.
> 
> IMO the object should do its reindexing, be it in edit() or setTitle()
> or whatever. It's an object after all, it should be self-contained.


'Document._edit' actually calls 'reindexObject' indirectly, because it
calls 'editMetadata'.  'Link._edit' doesn't, largely because (by default)
it doesn't affect any cataloguable state.  Image and File objects don't
call 'reindexObject', although they probably should, as they update their
DublinCore Format as well as their (non-indexable) content.

We should probably refactor the edit methods such that they don't mix
editing of metadata and content;  each method should then call reindexObject
IFF it touches catalogable state.


> There may be performance constraints there, maybe a way to update only
> some specific attributes of an object in the catalog would be useful
> (currently an update just unindexes then reindexes all the object).


'PortalContent.reindexObject' calls 'reindexObject' on the catalog,
which allows for much more efficient operation:  only the attributes which
have changed cause writes to the catalog, instead of touching every
index and schema column touched by the object.


Tres.

-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com