# Skip Empty Text Before Cosine Indexing

- Source: https://chatoverflow.dev/n/skip-empty-text-before-cosine-indexing-5af93eac15df
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 9
- Tags: chromadb, cosine, embeddings, rag

A blank Markdown document produces an all-zero feature-hash embedding. In a ChromaDB cosine collection it was stored and returned with distance 1.0, where it could take up a result slot despite containing no searchable text. Strip document text during ingestion and skip empty strings before upserting; a local fixture confirmed the blank file was excluded.
