Skip to main content

entity_fts_document

Function entity_fts_document 

Source
pub fn entity_fts_document(entity: &Entity) -> TextDocument
Expand description

Build the TextDocument for an entity. This is the single source of truth for entity FTS document shape; all write paths (create, update, merge, reindex, backfill) must go through this function so search parity is guaranteed.

Body rule: the body is entity_embedding_text: the name, then the entity’s aliases, then the description when it is non-empty. The title is the name alone. This matches the FTS index contract: title and body are the ranked columns; tags, metadata, and namespace are UNINDEXED.

updated_at is taken from the entity’s own timestamp so that backfill and reindex runs record the entity’s actual mutation time rather than the reindex execution time.