{"id":21538,"library":"llama-index-vector-stores-elasticsearch","title":"LlamaIndex Vector Stores Elasticsearch","description":"Elasticsearch vector store integration for LlamaIndex. Provides ElasticsearchStore for indexing and querying vector embeddings with full Elasticsearch features. Current version: 0.6.0. Release cadence: follows llama-index releases.","status":"active","version":"0.6.0","language":"python","source_language":"en","source_url":"https://github.com/run-llama/llama_index/tree/main/llama-index-integrations/vector_stores/llama-index-vector-stores-elasticsearch","tags":["llamaindex","vector-store","elasticsearch","rag","retrieval"],"install":[{"cmd":"pip install llama-index-vector-stores-elasticsearch","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required for connecting to Elasticsearch instance.","package":"elasticsearch","optional":false},{"reason":"Core dependency for vector store interface.","package":"llama-index-core","optional":false}],"imports":[{"note":"Official import path.","symbol":"ElasticsearchStore","correct":"from llama_index.vector_stores.elasticsearch import ElasticsearchStore"}],"quickstart":{"code":"import os\nfrom llama_index.vector_stores.elasticsearch import ElasticsearchStore\n\nvector_store = ElasticsearchStore(\n    index_name=\"my_index\",\n    es_url=os.environ.get(\"ES_URL\", \"http://localhost:9200\"),\n    es_user=os.environ.get(\"ES_USER\", \"elastic\"),\n    es_password=os.environ.get(\"ES_PASSWORD\", \"changeme\"),\n)\nprint(\"Elasticsearch store created successfully.\")","lang":"python","description":"Initialize an ElasticsearchStore with environment variables for credentials."},"warnings":[{"fix":"Use `es_url` instead of `host` and `port`.","message":"In version 0.6.0, the parameter `es_url` replaced the deprecated `host` and `port` parameters. Code using old parameters will fail.","severity":"breaking","affected_versions":"<0.6.0"},{"fix":"Replace `distance_strategy=\"COSINE\"` with `similarity=\"cosine\"`.","message":"The `distance_strategy` parameter is deprecated in favor of using `similarity` parameter with values like \"cosine\" or \"l2\".","severity":"deprecated","affected_versions":">=0.6.0"},{"fix":"Set `create_index=True` when initializing the store, or manually create the index with proper dense_vector field mapping.","message":"ElasticsearchStore does not automatically create the index if it doesn't exist. You must either pre-create the index with appropriate mappings or use the `create_index` parameter.","severity":"gotcha","affected_versions":"all"},{"fix":"Always provide both user and password or use API key authentication.","message":"When using authentication, ensure you pass both `es_user` and `es_password`. Passing only one may lead to unexpected connection errors.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Delete the existing index and let the store recreate it with correct mapping, or update the index mapping to match the expected dense_vector type.","cause":"Elasticsearch index already exists with incorrect mapping for the embedding field (e.g., wrong dimension or type).","error":"elasticsearch.BadRequestError: BadRequestError(400, 'x_content_parse_exception', 'failed to parse field [mappings.properties.embedding]')"},{"fix":"Use the correct import: from llama_index.vector_stores.elasticsearch import ElasticsearchStore","cause":"Old import path: from llama_index.vector_stores import ElasticsearchStore (incorrect).","error":"AttributeError: module 'llama_index.vector_stores.elasticsearch' has no attribute 'ElasticsearchStore'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}