Logo
Classes

ElasticSearchVectorStore

Defined in: packages/providers/storage/elastic-search/src/ElasticSearchVector.ts:45

ElasticSearchVectorStore provides vector storage and similarity search capabilities using Elasticsearch. It extends BaseVectorStore to implement vector storage operations with Elasticsearch as the backend.

Extends

  • BaseVectorStore

Constructors

Constructor

new ElasticSearchVectorStore(init): ElasticSearchVectorStore

Defined in: packages/providers/storage/elastic-search/src/ElasticSearchVector.ts:66

Creates a new instance of ElasticSearchVectorStore

Parameters

init

ElasticSearchParams

Configuration parameters for Elasticsearch connection and indexing

Returns

ElasticSearchVectorStore

Overrides

BaseVectorStore.constructor

Properties

storesText

storesText: boolean = true

Defined in: packages/providers/storage/elastic-search/src/ElasticSearchVector.ts:46

Overrides

BaseVectorStore.storesText

Methods

client()

client(): Client

Defined in: packages/providers/storage/elastic-search/src/ElasticSearchVector.ts:99

Returns the Elasticsearch client instance

Returns

Client

The configured Elasticsearch client

Overrides

BaseVectorStore.client


add()

add(nodes): Promise<string[]>

Defined in: packages/providers/storage/elastic-search/src/ElasticSearchVector.ts:145

Adds nodes to the vector store

Parameters

nodes

BaseNode<Metadata>[]

Array of BaseNode objects to store

Returns

Promise<string[]>

Array of node IDs that were successfully stored

Throws

Error if nodes don't have embeddings

Overrides

BaseVectorStore.add


delete()

delete(refDocId, deleteOptions?): Promise<void>

Defined in: packages/providers/storage/elastic-search/src/ElasticSearchVector.ts:189

Deletes nodes from the vector store by reference document ID

Parameters

refDocId

string

Reference document ID to delete

deleteOptions?

object

Optional deletion parameters

Returns

Promise<void>

Overrides

BaseVectorStore.delete


query()

query(query, options?): Promise<VectorStoreQueryResult>

Defined in: packages/providers/storage/elastic-search/src/ElasticSearchVector.ts:255

Performs a vector similarity search query

Parameters

query

VectorStoreQuery

Vector store query parameters

options?

object

Optional query parameters

Returns

Promise<VectorStoreQueryResult>

Query results containing matching nodes, similarities, and IDs

Throws

Error if query embedding is not provided

Overrides

BaseVectorStore.query

On this page