Builds a Pinecone metadata filter from an explicit list of file names.
Emits trailing-space variants because some names were indexed with trailing whitespace,
so an exact-match filter still hits them.
Never undefined. An empty $in matches nothing, which is what an empty document set
means; returning undefined would mean NO filter, i.e. every chunk the patient has — the
exact opposite. Callers that genuinely want an unfiltered search pass no filter at all.
Builds a Pinecone metadata filter from an explicit list of file names.
Emits trailing-space variants because some names were indexed with trailing whitespace, so an exact-match filter still hits them.
Never undefined. An empty
$inmatches nothing, which is what an empty document set means; returning undefined would mean NO filter, i.e. every chunk the patient has — the exact opposite. Callers that genuinely want an unfiltered search pass no filter at all.