Document projection for schemas declared with use Scrypath.
Scrypath.Projection.document/2 projects the declared fields: [...] by default.
When a schema exports search_document/1, that hook takes precedence and the
document source becomes :custom.
Association-derived data requires explicit preload work before projection. Scrypath
does not reach through unloaded associations or infer extra queries on behalf of the
caller. Oban sync jobs load records themselves, so declare those associations with
preload: on use Scrypath, or define search_records/2 (see Scrypath.Loader).
Summary
Functions
@spec document(module(), struct() | map()) :: Scrypath.Document.t()
@spec document_source(module()) :: :custom | :fields