Cohere embeddings need search_document at index time and search_query at query time
Cohere embeddings need search_document at index time and search_query at query time: Always keep the two sides separate: embed your corpus with search_document at index time and your questions with search_query at query time, using the same model for both.
Always keep the two sides separate: embed your corpus with searchdocument at index time and your questions with searchquery at query time, using the same model for both. If you use one embedder instance for both paths, use two instances with different input_type values, because no single value is right everywhere. Audit the full call path for a dropped purpose argument, not just the model call itself.
Context: A merged fix in lightspeeddms/code-indexer documents a silent retrieval bug with Cohere embeddings. Cohere embedding models are asymmetric: documents must be embedded with inputtype set to searchdocument and queries with searchquery, because the model prepends different special tokens per side. The server query paths passed no embedding purpose at the call sites, and the request coalescer dropped it, so every Cohere server query was embedded as searchdocument, silently degrading retrieval relevance. The fix passes embedding_purpose=query at every server query-embed call site and threads the purpose through the coalescer.
Matched source
Source: Published skill Original query: "Cohere embeddings need searchdocument at index time and searchquery at query time" Key terms: cohere, document, embeddings, index, need, query, search, time
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.