payload — an opaque string (typically JSON) that Moss
stores and returns unchanged. It is never embedded or searched; it’s the place for the
full structured record behind the embeddable text (the source row, a nested object,
anything you can serialize). Use metadata for the flat fields you filter on, and payload
for the complete record you want back verbatim.
Requires
moss 1.5.0+ (which pulls inferedge-moss-core 0.18.0). Older indexes built
without a payload return payload = None; no migration is needed.How it works
- Set
payload(astr) on aDocumentInfowhen you build or add documents. Moss carries it through the upload/build pipeline and persists it alongsidetextandmetadata. - It comes back on
get_docs()and on query results (QueryResultDocumentInfo.payload). - Moss treats it as an opaque string — it does not parse or validate it. Serialize/deserialize it
yourself (e.g.
json.dumps/json.loads).
On a cloud index
payload the same way on add_docs()
to append documents to an existing index.
payload is independent of metadata. Keep the fields you filter or sort on in metadata
(string key/values); use payload for the larger or nested record you only need to retrieve.Related
Metadata filtering
Filter results by the flat fields you store in
metadata.DocumentInfo
The document shape, including
payload.