Skip to content

Search engines

VPick's built-in search matches text in the label, and in any searchKeys you name. When you need more, such as typo tolerance, relevance ranking or searching long descriptions, plug in a search engine through fetchOptions.

fetchOptions receives what the user typed and returns the matching options. VPick shows them in the order they come back, so the engine's ranking is kept, and handles the rest: waiting for typing to pause, cancelling stale requests, the searching and error rows, and keeping picked options after the results change.

Pick your engine

Which one

You haveUse
A few thousand short labels, and people misspell themFuse.js
Records with longer text, such as titles and descriptionsFlexSearch
More data than belongs in the page, or it changes oftenYour server
Short labels, spelled rightNothing extra. The built-in search is enough.

VPick has no dependencies of its own, and none of these become one. You install the engine you choose in your app.

Released under the MIT License.