Quick Update
Even though I got the school
DataGridField field inside of the subform to index, searching for the school wasn't working.
Solution for searching for the subform field
I Added a custom SearchableTextExtender based on collective.dexteritytextindexer documentation.
from collective import dexteritytextindexer
from zope.component import adapts
from zope.interface import implements
class JaDMemberSearchableTextExtender(object):
adapts(IMember)
implements(dexteritytextindexer.IDynamicTextIndexExtender)
def __init__(self, context):
self.context = context
def __call__(self):
"""Extend the searchable text with a custom string"""
return " ".join([edu['school'] for edu in self.context.education])
ZCML:
<adapter factory=".indexers.MemberSearchableTextExtender" name="IMember" />
I think I could have used collective.dexteritytextindexer.IDexterityTextIndexFieldConverter
based on the documentation to convert the DataGridField
to searchable text, but it took more than 5 minutes to understand, therefore, I used dexteritytextindexer.IDynamicTextIndexExtender
instead.