Adding a catalog index in profiles/default/catalog.xml is deprecated; see http://maurits.vanrees.org/weblog/archive/2009/12/catalog.
I had some trouble getting this to work with a ZCTextIndex. I have a content type for which i want to be able to make the creator's full username searchable. In order to do this, i had to create a ZCTextIndex, as a simple FieldIndex didn't seem to work.
I got it to work by replacing the loop inside for name, meta_type in wanted: with this:
if name not in indexes:
if meta_type == 'ZCTextIndex':
class Empty: pass
title_extras = Empty()
#title_extras.doc_attr = 'index attribute?'
title_extras.index_type = 'Okapi BM25 Rank'
title_extras.lexicon_id = 'plone_lexicon'
catalog.addIndex(name, meta_type, title_extras)
logger.info("Added %s for field %s.", meta_type, name)
I'm using a dexterity-based content-type, the code contains:
creator = obj.Creator()
fullname = creator
membership = getToolByName(obj, 'portal_membership')
member = membership.getMemberById(creator)
fullname = '%s %s' % (member.getProperty('firstname'),