[ZCM] [ZC] 2342/ 2 Reject "bug in Catalog.py metadata not updated with keyword index"
"Collector: Zope Bugs, Features, and Patches ..." <[email protected]> Fri, 20 Jul 2007 16:19:47 -0400
| Newsgroups | gmane.comp.web.zope.devel.collector-monitor |
|---|---|
| Message-ID | <[email protected]> |
Issue #2342 Update (Reject) "bug in Catalog.py metadata not updated with keyword index"
Status Rejected, Catalog/bug medium
To followup, visit:
http://www.zope.org/Collectors/Zope/2342
==============================================================
= Reject - Entry #2 by tseaver on Jul 20, 2007 4:19 pm
Status: Pending => Rejected
The metadata columns are not updated when reindexing only a
sing index (or a set of them). Note that there is, in fact, no relationship at all between them; if you want to update the
metadata, you have to update *everything*.
________________________________________
= Request - Entry #1 by perry on Jul 20, 2007 5:06 am
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
else:
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:
else:
if True or data.get(index, 0) != newDataRecord:
data[index] = newDataRecord
==============================================================