[Zope-CMF] reindexObject problem

Dieter Maurer dieter@handshake.de
Thu, 6 Mar 2003 20:08:20 +0100


Yuppie wrote at 2003-3-5 19:25 +0100:
 > Using TextIndexNG, reindexObject doesn't delete words from the index 
 > that are deleted from SearchableText.
 > ...
 > ...
 > and this in CatalogTool.CatalogTool:
 > 
 >      def reindexObject(self, object, idxs=[]):
 >          url = self.__url(object)
 >          ## Zope 2.3 ZCatalog is supposed to work better if
 >          ## you don't uncatalog_object() when reindexing.
 >          # self.uncatalog_object(url)
 >          [...]
 >          self.catalog_object(object, url, idxs=idxs)
 > 
 > 
 > So now I think the reindex method is responsible for unindexing before 
 > reindexing. CMF doesn't support Zope 2.3 anyway, so maybe 
 > self.uncatalog_object(url) should be uncommented.

This was changed for efficiency (especially ZODB bloat) reasons:

  When you uncatalog and then catalog the catalog can not optimize
  by only changing the index for thing that actually changed.

  When you modify an object you rarely modify everything.
  The document's value with respect to many indexes will
  remain unchanged and these indexes do not need to do
  anything.

  When the value changes, maybe only the changes need to be
  taken care of. The KeywordIndex handles this intelligently.

  All these optimizations are lost when "reindex" first calls
  unindex.


Dieter