=== modified file 'src/Products/PluginIndexes/KeywordIndex/KeywordIndex.py' --- src/Products/PluginIndexes/KeywordIndex/KeywordIndex.py 2010-04-01 15:13:15 +0000 +++ src/Products/PluginIndexes/KeywordIndex/KeywordIndex.py 2010-05-15 23:11:57 +0000 @@ -70,7 +70,8 @@ try: for kw in newKeywords: self.insertForwardIndexEntry(kw, documentId) - self._unindex[documentId] = list(newKeywords) + if newKeywords: + self._unindex[documentId] = list(newKeywords) except TypeError: return 0 else: @@ -83,7 +84,10 @@ rdiff = difference(newKeywords, oldKeywords) if fdiff or rdiff: # if we've got forward or reverse changes - self._unindex[documentId] = list(newKeywords) + if newKeywords: + self._unindex[documentId] = list(newKeywords) + else: + del self._unindex[documentId] if fdiff: self.unindex_objectKeywords(documentId, fdiff) if rdiff: === modified file 'src/Products/PluginIndexes/interfaces.py' --- src/Products/PluginIndexes/interfaces.py 2010-04-14 14:02:08 +0000 +++ src/Products/PluginIndexes/interfaces.py 2010-05-15 23:16:41 +0000 @@ -34,10 +34,22 @@ def index_object(documentId, obj, threshold=None): """Index an object. - 'documentId' is the integer ID of the document. - 'obj' is the object to be indexed. - 'threshold' is the number of words to process between committing - subtransactions. If None, subtransactions are disabled. + - ``documentId`` is the integer ID of the document. + + - ``obj`` is the object to be indexed. + + - ``threshold`` is the number of words to process between committing + subtransactions. If None, subtransactions are disabled. + + For each name in ``getIndexSourceNames``, try to get the named + attribute from ``obj``. + + - If the object does not have the attribute, do not add it to the + index for that name. + + - If the attribute is a callable, call it to get the value. If + calling it raises an AttributeError, do not add it to the index. + for that name. """ def unindex_object(documentId):