Documentation
Namespaces
Datastore
interfaces
OptsHybrid

Interface: OptsHybrid<DocMeta, Filter>

Options for creating a hybrid Datastore instance (with Splade).

Extends

  • Opts<DocMeta, Filter>

Type parameters

Parameter
DocMeta extends BaseMeta
Filter extends BaseFilter<DocMeta>

Properties

PropertyTypeDescriptionInheritanceSource
cache?CacheStorage<string, QueryResult<DocMeta>>Enables caching for queries. Must implement .get(key) and .set(key, value), both of which can be either sync or async.

Some examples include: new Map(), quick-lru (opens in a new tab), or any keyv adaptor (opens in a new tab).
Opts.cachesrc/datastore/types.ts:95 (opens in a new tab)
cacheKey?CacheKey<Query<DocMeta, Filter>, string>A function that returns a cache key for the given params.

A simple example would be: (params) => JSON.stringify(params)

The default cacheKey function uses hash-object (opens in a new tab) to create a stable sha256 hash of the params.
Opts.cacheKeysrc/datastore/types.ts:89 (opens in a new tab)
contentKeykeyof DocMetaThe metadata key of the content that is embedded.
The value associated with the key must be a string.
Opts.contentKeysrc/datastore/types.ts:79 (opens in a new tab)
context?Ctx-Opts.contextsrc/datastore/types.ts:97 (opens in a new tab)
debug?booleanWhether or not to add default console.log event handlersOpts.debugsrc/datastore/types.ts:99 (opens in a new tab)
embeddingModelEmbeddingModel-Opts.embeddingModelsrc/datastore/types.ts:81 (opens in a new tab)
events?Events<DocMeta, Filter>-Opts.eventssrc/datastore/types.ts:96 (opens in a new tab)
namespace?string-Opts.namespacesrc/datastore/types.ts:80 (opens in a new tab)
spladeModelSparseVectorModelSplade instance for creating sparse vectors-src/datastore/types.ts:110 (opens in a new tab)