[Zope-CMF] Cannot index ZClass properties

S Haldar shaldar11@yahoo.com
Sat, 20 Jul 2002 17:37:55 -0700 (PDT)


I need to index ZClass properties with the
portal_catalog. I am not able to do that. Everytime
these index values come up as blank in the catalog
entry while they are getting populated in the actual
Object instance. Can anyone show me the light? Here's
what I am doing:

==========================
The properties to be indexed are "City" and
"District". 

So in portal_catalog metadata I created two entries of
the same name. I also created two indexes with the
respective names and type "FieldIndex".

 
My Object class is subclassed from CatalogAware

In my object instance creation script I use the
following two lines:
    
thisObj.propertysheets.tbProperties.manage_changeProperties
({'Customer_Name':custs.Ship_To_Name,
'Customer_Address':custs.Street, 'City':custs.City,
'State':custs.State, 'Zip':custs.Zip,
'District':custs.District})


thisObj.reindexObject()
=====================================

This doesn't work.

Now I need to be able to index City and District so
that I can do a "sort_on" call on either one of them. 


Since this is not working, I did a workaround by
extending the "SearchableText()" method to return the
District, and I do a sort_on on this. But this is not
a flexible solution. Is there anything else I should
do to get the correct index values populated from the
object properties?


Best regards,
Susmit



__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com