Autocomplete
Autocomplete underwent major structural maintenance in version 26.4, making the response time of the global autocomplete significantly faster, but with some changes to the details of the feature
What is autocomplete?
Autocomplete lets you suggest existing metadata values as a user types. Given a partial input string, MediaHaven looks through the indexed record metadata and returns matching terms, along with a score indicating how often each term appears. This is ideal for building type-ahead inputs in search forms or metadata editors.
Matching is case-insensitive and works on any part of the value, not just the beginning. Typing zea will match New Zealand.
Choosing a field scope
Every autocomplete request targets a metadata family. The field parameter controls which fields contribute suggestions:
GLOBAL (default): draws from all fields that have been marked as global in the MediaHaven configuration. Values are tokenised into individual words before indexing, so a field containing
New Zealandcontributes bothNewandZealandas potential suggestions. Use this for general-purpose search bars.SPECIFIC Descriptive, Administrative, Technical, Dynamic: restricts suggestions to fields in that specific metadata family. Values are matched as-is (not tokenised), so
New Zealandonly appears as a single term. Use these when you know which part of the metadata your users are editing.
Not every field type is eligible. Boolean, date, numeric, and free-text fields are excluded; only simple string-valued fields participate in autocomplete.
Rights Management
Access GLOBAL SPECIFIC
Suggestions are only based on records to which the user has access, based on the combination of
Read rights → Permissions & Rights
Access to the record phase --> MediaHaven Record Status
Organisation scoping GLOBAL SPECIFIC
In multi-tenant deployments with a shared index, you may want to prevent users from seeing terms that originate from other organisations' content. Setting indexWide to false restricts suggestions to records belonging to the authenticated user's organisation.
Scoping suggestions to relevant records SPECIFIC
By default, specific non-global suggestions are drawn from every accessible record in the index for the user. You can narrow this down with a structured query, the same query syntax used in the search API. When you provide a query, it returns only terms that appear in matching records.
For example, if a user is browsing a specific collection, passing that collection as a filter means the suggestions will reflect the content of that collection rather than the entire archive. This keeps suggestions contextually relevant and avoids surfacing values the user would never actually find in their current view.
Results
Delay
GLOBAL For global autocomplete, results are based on cached input that is periodically rebuilt (i.e. daily). The appearance of new values can be delayed until the cache has been rebuilt in the background.
SPECIFIC For non-global autocomplete, the results are calculated on the live data.
Scoring
Each suggestion comes with a score.
GLOBAL A higher score means the term was more recently used
SPECIFIC A higher score means the term is more common
Result count
By default, up to 10 suggestions are returned. This can be increased up to a maximum of 100 via the nrOfResults parameter.
Fine-tuning
Word length constraints GLOBAL
When building global autocomplete suggestions, individual words extracted from field values are filtered by length:
Minimum word length:
3characters; words shorter than this are excluded from suggestions.Maximum word length:
32characters; words longer than this are excluded from suggestions.
For example, a field containing New Zealand would contribute the suggestion New (3 characters, included) and Zealand (7 characters, included). A field containing a b Zoo SupercalifragilisticexpialidociousSomethingEvenLonger would contribute only Zoo (3 characters, included), as a and b are too short and the last term exceeds the 32-character limit.