Skip to content

createSearch beta ​

Function of @v12-engine/client/kit

ts
export declare function createSearch<T>(items: readonly T[], options: SearchOptions<T>): Search<T>;

A search over a list, for a panel, a shop, a tool: search(query) gives the items the words typed find, the best first (SearchHit.rank), each with the letters that matched (matches, for a Highlight). Reads what keys say of each item, name over id over description over tags by their weights; a typo finds (flsh is Flash) after everything found as typed. Keeps an index between keystrokes: set(items) when the list changes (what is the same is kept). Five thousand items search in a few milliseconds