diff --git a/src/collective/dms/thesaurus/configure.zcml b/src/collective/dms/thesaurus/configure.zcml index 95d3f7d..7e12d0b 100644 --- a/src/collective/dms/thesaurus/configure.zcml +++ b/src/collective/dms/thesaurus/configure.zcml @@ -2,6 +2,7 @@ xmlns="http://namespaces.zope.org/zope" xmlns:grok="http://namespaces.zope.org/grok" xmlns:browser="http://namespaces.zope.org/browser" + xmlns:plone="http://namespaces.plone.org/plone" xmlns:i18n="http://namespaces.zope.org/i18n" xmlns:genericsetup="http://namespaces.zope.org/genericsetup" i18n_domain="collective.dms.thesaurus"> @@ -24,13 +25,10 @@ - + + + + + diff --git a/src/collective/dms/thesaurus/indexers.py b/src/collective/dms/thesaurus/indexers.py new file mode 100644 index 0000000..2a84793 --- /dev/null +++ b/src/collective/dms/thesaurus/indexers.py @@ -0,0 +1,23 @@ +from zope.interface import Interface +from plone.indexer import indexer + +#from collective.dms.thesaurus.dmskeyword import IDmsKeyword + +class IDmsKeywordIndexer(Interface): + """Dexterity behavior interface for enabling the dynamic SearchableText + indexer on Document objecgs.""" + + +@indexer(IDmsKeywordIndexer) +def dmskeyword_searchable_text(obj): + indexed_fields = [] + title = obj.Title() + if isinstance(title, unicode): + title = title.encode('utf-8') + indexed_fields.append(title) +# equivs = obj.get_equivs() +# for equiv in equivs: +# if isinstance(title, unicode): +# equiv = title.encode('utf-8') +# indexed_fields.append(equiv) + return u' '.join(indexed_fields) diff --git a/src/collective/dms/thesaurus/profiles/default/types/dmskeyword.xml b/src/collective/dms/thesaurus/profiles/default/types/dmskeyword.xml index 6007a9c..4e793a8 100644 --- a/src/collective/dms/thesaurus/profiles/default/types/dmskeyword.xml +++ b/src/collective/dms/thesaurus/profiles/default/types/dmskeyword.xml @@ -23,7 +23,7 @@ - +