Computed fields in Contracts
Role: Developer working with Optimizely CMS 13 and Optimizely Graph.
Problem:
I am implementing search across multiple content types (pages, media etc.) using Optimizely Graph.
A common requirement is to expose consistent search fields across different content types, for example SearchTitle and SearchDescription, while allowing each content type to derive those values from its own properties and fallback logic.
The current limitation is that computed fields cannot be exposed through Contracts. While computed fields can be defined on concrete content types and avoid storing redundant search data, they cannot be used to create a unified schema across multiple content types.
For search scenarios, fields such as SearchTitle and SearchDescription are really search projections rather than editor-managed content. To expose these fields through a Contract today, they must be persisted in the content model, even though they are derived projections rather than actual content.
Desired outcome:
Ideally, it should be possible to create a unified search schema backed by computed fields, without having to persist derived values in the content model.
This would allow developers to expose consistent search fields across pages, media and other content types while keeping the content model free from search-specific properties and publish-time population logic.