I have a Plone 4.3 site, and I'd like to override the
Description indexer; I have a function to extract the first NNN visible characters from HTML text, preserving selected HTML tags (excluding
href attributes etc.). I'd like to use this "head" (after the console program) for my
Description and some other indexers are defined by plone.app.discussion, for the
IComment interface, which also contains schema fields.
When I simply define my indexer, using a dedicated interface (just for this purpose), it is not used; the indexer from plone.app.discussion always wins.
When I make my interface inherit from
plone.app.discussion.interfaces.IComment instead of
zope.interface.Interface, it is used; but apparently all other indexers defined for the IComment interface are tried as well, and this causes trouble; the existence of all the other fields defined in the schema is assumed, which don't exist for my non-comment AT content types.
So, what can I do?
- Is there a way to reliably override an indexer? (I tried to use my browser layer, but this seems not to work for adapters)
- Would I need a new version of plone.app.discussion which uses a dedicated interface just for the indexers, separated from the
ICommentinterface which contains the schema?