Elasticsearch Vector Store
The Elasticsearch Vector Store node is a component that integrates Elasticsearch, a distributed search and analytics engine, into a vector store system for similarity search and document retrieval.
Node Details
-
Name: Elasticsearch_VectorStores
-
Type: Elasticsearch
-
Version: 2.0
-
Category: Vector Stores
Base Classes
-
Elasticsearch
-
VectorStoreRetriever
-
BaseRetriever
Credentials
The node requires one of the following credentials:
-
elasticsearchApi
-
elasticSearchUserPassword
Input Parameters
-
Document (optional, list)
-
Type: Document
-
Description: List of documents to be added to the vector store
-
-
Embeddings
-
Type: Embeddings
-
Description: Embedding model to use for vectorizing documents
-
-
Record Manager (optional)
-
Type: RecordManager
-
Description: Manages records to prevent duplication
-
-
Index Name
-
Type: string
-
Description: Name of the Elasticsearch index to use
-
-
Top K (optional)
-
Type: number
-
Default: 4
-
Description: Number of top results to fetch
-
-
Similarity (optional)
-
Type: options
-
Default: l2_norm
-
Options: l2_norm, dot_product, cosine
-
Description: Similarity measure used in Elasticsearch
-
Outputs
-
Elasticsearch Retriever
-
Type: retriever
-
Base Classes: [Elasticsearch, VectorStoreRetriever, BaseRetriever]
-
-
Elasticsearch Vector Store
-
Type: vectorStore
-
Base Classes: [Elasticsearch, ElasticVectorSearch]
-
Functionality
Upsert Method
-
Adds or updates documents in the Elasticsearch index
-
Handles document flattening and metadata cleaning
-
Supports record management to prevent duplication
Delete Method
-
Deletes documents from the Elasticsearch index
-
Supports deletion by IDs or using a record manager
Init Method
-
Initializes the Elasticsearch vector store
-
Creates a retriever or returns the vector store based on the output type
Usage
This node is used for:
-
Storing document embeddings in Elasticsearch
-
Performing similarity searches on stored embeddings
-
Retrieving relevant documents based on vector similarity
It’s particularly useful in applications requiring semantic search capabilities or when working with large datasets that need efficient similarity-based retrieval.
Note
The node includes a workaround for a bug in the underlying library (Langchain Issue #1589) where the store doesn’t support objects in metadata. It removes ‘pdf’ and ‘loc’ fields from document metadata to prevent silent failures.
Was this page helpful?