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: when the entity has a non-empty description, prepend the name ("<name> <description>"). Otherwise the body is just the name. 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.