ZCataloging objects added by batch within a Product
Hi, I have a Product class ( OrderedFolder, PropertyManager ) which adds a zCatalog(id = 'Catalog' ) when it is created. A batch process uploads a file which contains the data to add objects of class tPatient( CatalogAware, OrderedFolder, PropertyManager ). Catalog has a fieldIndex on 'surname'. After the upload the patients appear in the Catalog but the ZSearchInterface form will not return any results. Search on null input produces all the tPatients. If I edit a tPatient instance, the search interface will then return the correct patient thru the SearchInterface form. The tPatient.editPatient method calls self.reindex_object(). Have tried deleting and creating Catalog by hand and looking at ZCatalog.py to no avail. David
David Little wrote at 2003-9-26 16:17 +0100:
I have a Product class ( OrderedFolder, PropertyManager ) which adds a zCatalog(id = 'Catalog' ) when it is created.
A batch process uploads a file which contains the data to add objects of class tPatient( CatalogAware, OrderedFolder, PropertyManager ).
Catalog has a fieldIndex on 'surname'.
After the upload the patients appear in the Catalog but the ZSearchInterface form will not return any results. Search on null input produces all the tPatients.
Apparently, the initial cataloging happens too early (before "surname" is defined). The intial cataloging is performed in "_setObject". When you change something later, you have to call "index_object" again. Dieter
participants (2)
-
David Little -
Dieter Maurer