class OpenSearchVectorStoreClass that provides a wrapper around the OpenSearch service for vector search. It provides methods for adding documents and vectors to the OpenSearch index, searching for similar vectors, and managing the OpenSearch index.
Embeddings interface for generating vector embeddings from text queries, enabling vector-based similarity searches.
Returns a string representing the type of vector store, which subclasses must implement to identify their specific vector storage type.
Method to add documents to the OpenSearch index. It first converts the documents to vectors using the embeddings, then adds the vectors to the index.
Method to add vectors to the OpenSearch index. It ensures the index exists, then adds the vectors and associated documents to the index.
Creates a VectorStoreRetriever instance with flexible configuration options.
Builds metadata terms for OpenSearch queries.
This function takes a filter object and constructs an array of query terms compatible with OpenSearch 2.x. It supports a variety of query types including term, terms, terms_set, ids, range, prefix, exists, fuzzy, wildcard, and regexp. Reference: https://opensearch.org/docs/latest/query-dsl/term/index/
Deletes documents from the vector store based on the specified parameters.
Method to delete the OpenSearch index if it exists.
Method to check if the OpenSearch index exists.
Return documents selected using the maximal marginal relevance. Maximal marginal relevance optimizes for similarity to the query AND diversity among selected documents.
Searches for documents similar to a text query by embedding the query and performing a similarity search on the resulting vector.
Method to perform a similarity search on the OpenSearch index using a query vector. It returns the k most similar documents and their scores.
Searches for documents similar to a text query by embedding the query, and returns results with similarity scores.
Static method to create a new OpenSearchVectorStore from an array of Documents, embeddings, and OpenSearch client arguments.
Static method to create a new OpenSearchVectorStore from an existing OpenSearch index, embeddings, and OpenSearch client arguments.
Static method to create a new OpenSearchVectorStore from an array of texts, their metadata, embeddings, and OpenSearch client arguments.
The name of the serializable. Override to provide an alias or to preserve the serialized module name in minified environments.
Implemented as a static method to support loading logic.