Full-text search for Svelte 5 apps
FTS5 / tsvector, trigram fuzzy matching, geo proximity, synonym expansion, query resolution,
Polish locale support. Driven by your own database via a pluggable schema adapter.
pnpm add @nomideusz/svelte-search1. Normalize & tokenize
Normalized
hatha w warszawie blisko mnieAfter stripGeoIntent
hatha w warszawieAfter stripStopWords
hatha warszawieGeo intent yes
Postcode? no
Token count
2Tokens
hathawarszawie
Trigrams (10)
hataththawararsrszszazawawiwie
2. Similarity
Trigram similarity
0.250 25%Levenshtein distance
1 editLevenshtein similarity
0.800 80%3. Geo helpers
Haversine distance
252.35 kmformatDistance
252.4 kmWalking time
4101 minformatWalkingTime
68 hr 21 min walkBounding box (for SQL pre-filter)
{
minLat: 52.18408,
maxLat: 52.27392,
minLng: 20.93867,
maxLng: 21.08533
}4. Query resolver
Location
warsaw Category
hatha Postal code —
Geo intent no
Remaining tokens
mokotow
Raw ParsedQuery
{
"normalized": "hatha w warszawie mokotow",
"working": "hatha warszawie mokotow",
"geoIntent": false,
"location": {
"matched": "warszawie",
"slug": "warsaw",
"original": "warszawie"
},
"category": {
"matched": "hatha",
"slug": "hatha",
"original": "hatha"
},
"rest": [
"mokotow"
]
}Lookup data used in this demo
locationMap (14)
includes Polish locative forms — "warszawie" and "warszawa" both resolve to warsaw.
categoryMap (8)
yoga styles: hatha, vinyasa, yin, ashtanga, kundalini, power, restorative, nidra.
areaMap (6 locations)
districts per city — e.g. Warsaw: mokotow, praga, wola, ochota, śródmieście.
Ready to wire it up to your DB? See the docs for the full SchemaAdapter contract.