Entry
How can I automatically update my ZCatalog when items have been added/modified/changed?
Aug 9th, 2000 05:26
unknown unknown, R. David Murray
Any objects that you want to be automatically updated in the Catalog
must have CatalogAware as one of their base classes. And then you
have to add a reindex_object call to any forms that add or update them.
(I fail to understand why one has to explictly call reindex_object when
properties change, even though I think someone tried to explain it to me
once).
I suppose you could do something similar with non-catalog aware objects,
where you made sure the add/update forms called the Catalog to index
them, but they wouldn't get deleted from the catalog automatically, or
reindexed automaticaly when moved. If you are writing your own
management screens for those operations, though, you could make it all
work, I think.
You could also use ZSchedular to perioducally run the commands to
reindex your site, if instaneous reindexing is not a requirement.