Skip to content

TurnCache

new TurnCache(): TurnCache;

TurnCache

get size(): number;

Number of cached queries.

number

clear(): void;

Clear all cached entries.

void


get(query): RetrievalResult[] | undefined;

Get cached results for an exact query string. Returns undefined on cache miss.

Parameter Type

query

string

RetrievalResult[] | undefined


has(query): boolean;

Check if the cache has results for a query.

Parameter Type

query

string

boolean


set(query, results): void;

Store results for a query string.

Parameter Type

query

string

results

RetrievalResult[]

void