we use ZCatalogs as tables, to store data for rapid access and searching. Recently we added a keyword index to one table, and found that the metadata of the index is not updated, when a keyword is added.The name of the index and metadata is the same "registered_courses". I found in Catalog.py updateMetadata around line 306

            if data.get(index, 0) != newDataRecord:
                data[index] = newDataRecord

the if condition evaluates always to false, cause the data.get(index,0) accesses the data of the index and not of the metadata field as long as Zope was not restarted that worked fine. But after a restart the metadata field always only contained the first added keyword, the index
was still ok.
After I changed the above code to:

            if True or data.get(index, 0) != newDataRecord:
                data[index] = newDataRecord

It works as exspected.

Gruß Joachim

For more information about ZODB, see the ZODB Wiki:

ZODB-Dev mailing list  -  ZODB-Dev@zope.org

Reply via email to