Default File
content has its own SearchableText
indexer defined in plone.app.contenttypes
.
I just tried the textindexer
as documented and get the following traceback for NamedBlobFile
field:
Traceback (innermost last):
Module ZPublisher.WSGIPublisher, line 187, in transaction_pubevents
Module transaction._manager, line 257, in commit
Module transaction._manager, line 134, in commit
Module transaction._transaction, line 267, in commit
Module transaction._transaction, line 333, in _callBeforeCommitHooks
Module transaction._transaction, line 372, in _call_hooks
Module Products.CMFCore.indexing, line 317, in before_commit
Module Products.CMFCore.indexing, line 227, in process
Module Products.CMFCore.indexing, line 49, in reindex
Module Products.CMFCore.CatalogTool, line 368, in _reindexObject
Module Products.CMFPlone.CatalogTool, line 324, in catalog_object
Module Products.ZCatalog.ZCatalog, line 495, in catalog_object
Module Products.ZCatalog.Catalog, line 362, in catalogObject
Module Products.ZCTextIndex.ZCTextIndex, line 170, in index_object
Module plone.indexer.wrapper, line 65, in __getattr__
Module plone.indexer.delegate, line 20, in __call__
Module plone.app.dexterity.textindexer.indexer, line 85, in dynamic_searchable_text_indexer
AssertionError: expected converted value of IDexterityTextIndexFieldConverter to be a str
Sample Code:
from plone.app.dexterity import textindexer
from plone.namedfile import field as namedfile
from plone.supermodel import model
class IExampleSchema(model.Schema):
test_file = namedfile.NamedBlobField(title="searchable file")
textindexer.searchable("test_file")
and enabled behavior in exampe_type.xml
<property name="behaviors" purge="false">
<element value="plone.textindexer" />
</property>