Skip to content

five-on-it / packages/catalogue/src/catalogue / searchCatalogue

Function: searchCatalogue() ​

searchCatalogue(query): CatalogueEntry[]

Defined in: packages/catalogue/src/catalogue.ts:37

The entries a query's words find, best first: a word in the id counts most, then in the title and the kind, then in a kit piece's tags, then each time it occurs in the doc (three times at most); the start of a word counts half; the word a title starts with counts one more (sports car finds the sports before the police car). A kit piece scores half, after the building or the switch a spec names (hospital finds the building before the pieces it is made of). An empty query finds nothing.

Parameters ​

query ​

string

Returns ​

CatalogueEntry[]