Re: [Zope3-Users] FieldIndex on boolean field - error
Hi, On Wed, Mar 28, 2007 at 03:55:28PM +, Alek Kowalczyk wrote: Hi, I'm trying to index a boolean field of some object, to simplify retrieving all the objects which have some flag turned on. I am adding in proper place the index: catalog['anomaly'] = FieldIndex('anomaly', IMyObject) But then, when I try to get the objects using the following command, I get an exception. Is FieldIndex able to index bool field? If not, how to create own index for doing that? anomalies = catalog.searchResults(anomaly=True) [snip] TypeError: len() of unsized object A fieldindex always requires a lower and an upper boundary, found objects must fit into. Try catalog.searchResults(anomaly=(True,True)) BTW: The error is raised because the fieldindex tries to interpret 'True' as a tuple. Regards, Frank ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] fieldindex
hi all, I have a catalog set up, and i've been able to make text field work on zmi-added content. however, what i really want to be able to index and search is a set of objects that are created and archived elsewhere. I've tried to add a field index with the interface set to the interface that my objects implement, and a field to an attribute (like 'name') of the object, with no luck. as a test, i tried to add a field index on IZopeDublinCore and use the field_name as title. still no luck. has anyone else had any experience with making field indexes work? Thanks as always, Pete ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] fieldindex
Pete Taylor wrote: hi all, I have a catalog set up, and i've been able to make text field work on zmi-added content. however, what i really want to be able to index and search is a set of objects that are created and archived elsewhere. I've tried to add a field index with the interface set to the interface that my objects implement, and a field to an attribute (like 'name') of the object, with no luck. as a test, i tried to add a field index on IZopeDublinCore and use the field_name as title. still no luck. Hi Pete, And callable is off And tried it and worked for me. Aren't you seeing the doc. and word counts change in the catalog Advanced page as you add/del. objects? has anyone else had any experience with making field indexes work? Thanks as always, Pete ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users