/** * @module @nhtio/adk/batteries/vector/elasticsearch * * Elasticsearch 8 adapter — each collection is an index with a `dense_vector` field; KNN uses ES8's * top-level `knn` search clause with an optional `filter`; the neutral filter tree compiles to bool/term/range * over `metadata.*`. Distinct from the opensearch adapter (which speaks OpenSearch's `knn_vector`/`query.knn` dialect). */ import { BaseVectorStore } from "../contract"; import type { VectorFilter } from "../filters"; import type { SearchPlan, UpsertPlan, DeletePlan, CollectionSpec } from "../plan"; import type { VectorMatch, VectorStoreCapabilities, BaseVectorStoreOptions } from "../types"; export interface ElasticsearchVectorStoreOptions extends BaseVectorStoreOptions { /** Connection and authentication parameters for the backend. */ connection?: { node?: string; auth?: { username: string; password: string; } | { apiKey: string; }; client?: unknown; }; } /** * Compile the neutral filter tree to an Elasticsearch bool-query clause over `metadata.*`. * String values use the `.keyword` sub-field for exact match; numbers use range/term. */ export declare const translateElasticsearchFilter: (filter?: VectorFilter) => Record | undefined; export declare class ElasticsearchVectorStore extends BaseVectorStore { #private; readonly capabilities: VectorStoreCapabilities; /** Static availability probe: whether this adapter's runtime driver can load in the current environment. */ static isAvailable(): boolean; isAvailable(): boolean; connect(): Promise; close(): Promise; createCollection(spec: CollectionSpec, ifNotExists: boolean): Promise; dropCollection(collection: string, ifExists: boolean): Promise; hasCollection(collection: string): Promise; renameCollection(_from: string, _to: string): Promise; executeUpsert(plan: UpsertPlan): Promise; executeSearch(plan: SearchPlan): Promise; executeDelete(plan: DeletePlan): Promise; }