Thanks, that gave me some more ideas:
Like you already mentioned, the mechanism that Dexterity uses (used? I think I read something about it being the default now), to add field content to SearchableText is something that you can piggyback on.
urprodukt_code = schema.TextLine(
title=_(u'Urprodukt Kürzel'),
description=_(u'Beim Eintragen beachten, dass das Kürzel einzigartig ist'),
required=True,
min_length=6,
max_length=6,
)
directives.widget(
'urprodukt_code',
AjaxSelectFieldWidget,
vocabulary='plone.app.vocabularies.Keywords',
pattern_options={"maximumSelectionSize": 1},
allowNewItems=True,
)
dexteritytextindexer.searchable('urprodukt_code')
Practically speaking, I can’t really help you there: I remember adding this to a Plone 5.0 site once. It let me search for formulation or article ids and find the documents that referred to those. Upgrading to Plone 5.1 broke it, and life went on without the feature that nobody besides me had ever thought of using
I do remember that a catalog rebuild did not fix the bug.
For the UX, you could think of implementing a viewlet that replaces the current searchbox and injects something that searches your taxonomy vocabulary (if possible – I “think” I remember not using collective.taxonomy at the time because I could not easily get to the actual data).
I have circled this topic on many occasions but never found the holy grail. Potential strategy may include searching a NamedVocabulary, VocabularySource, REST endpoint or plain JSON for the terms that your user is typing, and offering these up in your results. Heavy customization territory, I don’t know if your project budget supports such a deep dive...
Keep us posted on your progress!