Static method to create an ElasticVectorSearch instance from texts. It creates Document instances from the texts and their corresponding metadata, then calls the fromDocuments method to create the ElasticVectorSearch instance.
fromTexts(
texts: string[],
metadatas: object | object[],
embeddings: EmbeddingsInterface,
args: ElasticClientArgs
): Promise<ElasticVectorSearch>| Name | Type | Description |
|---|---|---|
texts* | string[] | The texts to create the ElasticVectorSearch instance from. |
metadatas* | object | object[] | The metadata corresponding to the texts. |
embeddings* | EmbeddingsInterface | The embeddings to use for the documents. |
args* | ElasticClientArgs | The arguments to create the Elasticsearch client. |