The Plone search field only uses the SearchableText
index.
This is a full text index that most types fill with the concatenated result (a string) of all fields that should be included in the results.
There is a collective.dexteritytextindexer
package that makes filling the SearchableText
index for dexterity types easier.
Add the behaviour from that package to your type:
<property name="behaviors">
<element value="collective.dexteritytextindexer.behavior.IDexterityTextIndexer" />
</property>
then mark your varenummer
field as part of the index:
from collective import dexteritytextindexer
class IVare(form.Schema):
"""Leverandør type, som kan oprettes alle steder.
"""
dexteritytextindexer.searchable('varenummer')
varenummer = schema.TextLine(
title=_(u"Varenummer"),
)