Static method to create an ElasticVectorSearch instance from Document instances. It adds the documents to the Elasticsearch database, then returns the ElasticVectorSearch instance.
fromDocuments(
docs: Document<Record<string, any>>[],
embeddings: EmbeddingsInterface,
dbConfig: ElasticClientArgs
): Promise<ElasticVectorSearch>| Name | Type | Description |
|---|---|---|
docs* | Document<Record<string, any>>[] | The Document instances to create the ElasticVectorSearch instance from. |
embeddings* | EmbeddingsInterface | The embeddings to use for the documents. |
dbConfig* | ElasticClientArgs | The configuration for the Elasticsearch database. |