[ZCM] [ZC] 291/ 1 Request "ZCatalog deleting an indexed property"

Collector: Zope Bugs and Patches ... zope-coders@zope.org
Wed, 13 Mar 2002 07:56:26 -0500


Issue #291 Update (Request) "ZCatalog deleting an indexed property"
 Status Accepted, Catalog/bug+solution medium
To followup, visit:
  http://collector.zope.org/Zope/291

==============================================================
= Request - Entry #1 by htrd on Mar 13, 2002 7:56 am

 Status: Pending => Accepted

 Supporters added: htrd


Uploaded:  "deleteproperty.diff"
 - http://collector.zope.org/Zope/291/deleteproperty.diff/view
Suppose a ZCatalog FieldIndex has indexed an object A with a property B. The A.B has the value 'hello'.


Now A.B changes to the value 'world', and the object is reindexed. The field index reindex_object does its work in two phases:

1. First it removes the forward mapping 'hello'->docid

2. It adds a new forward mapping 'world'->docid and overwrites the reverse mapping to docid->'world'


Now suppose that property is deleted, and the object reindexed.

The first phase happens as before, removing the forward mapping 'world'->docid. The second phase does not happen because there is no new forward mapping.

However, this leave the indexes in an inconsistent state, because the reverse mapping docid->'world' is still present. The code for the first phase doesnt remove it because it is assuming the second phase will overwrite it, but that does not account for cases where the property is removed and the second phase is not run.


==============================================================