The accepted solution may be slightly obscure, so here are a couple of clarifications:
1) Do NOT edit your global generic setup.
Unless you're doing something extremely weird, you'll have setup your site as a series of plone extensions, and have a folder structure like:
app.plugin/
app.plugin/app/
app.plugin/app/configure.zcml
app.plugin/app/profiles/
app.plugin/app/profiles/default
app.plugin/app/profiles/default/types
app.plugin/app/profiles/default/types/Folder.xml
app.plugin/app/profiles/default/types/app.mydexteritytype.xml
app.plugin/app/profiles/default/types.xml
app.plugin/app/profiles/default/portlets.xml
app.plugin/app/profiles/default/catalog.xml <---- ADD THIS
2) You don't have to have an xml block (as per the accepted solution) in catalog.xml, you can just create the index from the frontend ZMI. However, if you do this, it'll get blown away the next time you install your plugins. So you probably do want to.
3) After installing your catalog.xml, browse to the ZMI interface to portal_catalog and check that under the 'indexes' tab your index exists. If it doesn't you've messed up.
4) To build the index, you need to go the 'advanced' tab and choose rebuild.
5) The indexer greedily consumes exceptions and does not raise them (especially important for AttributeError; you may not index some values you want to be indexing), so if you want to make sure your indexer is actually running, try adding a log or print statement in it:
@indexer(IMyDexterityType)
def dummy_indexer(obj, **kw):
try:
print('indexed: %r' % obj)
return obj.title
except Exception as e:
print('index fail: %r' % e)
return ''
If nothing else you should see some output like:
2013-08-12 16:42:28 INFO GenericSetup.archetypetool Archetype tool imported.
2013-08-12 16:42:28 INFO GenericSetup.resourceregistry Stylesheet registry imported.
2013-08-12 16:42:28 INFO GenericSetup.resourceregistry Javascript registry imported.
indexed: <MyDexterityType at /Plone/test/cat-document-0>
indexed: <MyDexterityType at /Plone/test/hello>
6) grok.global_adapter() as mentioned in some of the documentation (http://developer.plone.org/reference_manuals/external/plone.app.dexterity/advanced/catalog-indexing-strategies.html?highlight=custom%20indexing#creating-custom-indexers) is about registering virtual properties, and does not mitigate the need to setup your catalog.xml.
Finally, someone's put a working example up on github here, which is extremely useful:
https://github.com/aclark4life/event_days_indexer