medium severityElasticsearch indexing (dense_vector fields), LangChain ElasticsearchStore integrations
Indexing fails with mapper_parsing_exception: "The [dense_vector] field [embedding] in doc [id] has more/fewer dimensions than defined in the mapping [expected]". Document rejected, bulk operations partially fail.[LangChain JS GitHub #6041](https://github.com/langchain-ai/langchainjs/issues/6041)
Root cause
Elasticsearch strictly enforces that all vectors indexed into a dense_vector field have exactly the number of dimensions ('dims') defined in the index mapping (or inferred from first vector if optional 'dims' omitted). Mismatch between embedding model output and mapping causes parse failure during indexing.[Elasticsearch Docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/dense-vector.html)
elasticsearchdense_vectormapper_parsing_exceptiondimension mismatchembeddingindex mapping