@nomideusz/svelte-search 0.1.3 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +51 -36
- package/LICENSE +21 -21
- package/README.md +297 -297
- package/dist/core/engine.d.ts +7 -0
- package/dist/core/engine.js +30 -24
- package/dist/core/indexer.js +19 -7
- package/dist/core/normalize.d.ts +7 -0
- package/dist/core/normalize.js +16 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/pl.js +463 -37
- package/package.json +27 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,36 +1,51 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## 0.1
|
|
4
|
-
|
|
5
|
-
###
|
|
6
|
-
-
|
|
7
|
-
|
|
8
|
-
## 0.
|
|
9
|
-
|
|
10
|
-
###
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
###
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
- **
|
|
34
|
-
- **
|
|
35
|
-
|
|
36
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.2.1 — 2026-07-19
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- **`polishLocative` no longer mangles the long tail of Polish town names.** The suffix rules cannot infer gender/number, so forms like "Dębicie" (correct: "Dębicy"), "Bolesławiecie" ("Bolesławcu"), "Bielskie-Białej" ("Bielsku-Białej"), and "Wrześniie" ("Wrześni") were produced for hundreds of towns. `LOCATIVE_IRREGULARS` now carries a hand-verified table of 487 localities — every Polish town with 10+ points in the kompi-recycling directory plus the yoga-directory localities — checked full-name-first before any suffix rule. Unlisted names still fall through to the rules as a best guess.
|
|
7
|
+
|
|
8
|
+
## 0.2.0 — 2026-07-06
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **Fuzzy quality gate is now per-word** — typo queries against multi-word entity names could never pass the Levenshtein gate (the query was compared to the whole field, so `"triranta"` vs `"Triratna Warszawa - Buddyzm i medytacja Mokotów"` scored ~0.17 and was rejected). The gate now uses the best of whole-field and per-word similarity; false-positive protection is unchanged (`"inowroclaw"` still does not match `"wroclaw"`).
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
- **`ftsColumnWeights` engine option** (SQLite) — per-column bm25 weights for FTS ranking, in FTS table column order. Without it all columns weigh equally, so a term repeated in a long description column outranks an exact name match before the result limit is applied. Weight name-like columns high and description-like columns low, e.g. `ftsColumnWeights: [10, 4, 4, 4, 3, 2, 0.5]`. Opt-in; behavior is unchanged when unset.
|
|
15
|
+
- **`bestWordSimilarity(query, field, locale?)`** exported from the package — max of whole-field and per-word normalized Levenshtein similarity.
|
|
16
|
+
- Community health files: code of conduct, contributing guide, security policy, issue and PR templates.
|
|
17
|
+
|
|
18
|
+
## 0.1.3 — 2026-06-29
|
|
19
|
+
|
|
20
|
+
### Security
|
|
21
|
+
- Bump vulnerable devDependencies to clear npm High CVE alerts: `vite` ^7.3.1 → ^7.3.5, `vitest` ^4.0.18 → ^4.1.0, `@sveltejs/kit` ^2.50.2 → ^2.60.1. No runtime deps affected.
|
|
22
|
+
|
|
23
|
+
## 0.1.2 — 2026-06-17
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
- Add `homepage` field pointing to the live demo (now shown as Homepage on npm).
|
|
27
|
+
- Add a live-demo link to the README.
|
|
28
|
+
- Ship the MIT `LICENSE` file in the published tarball (previously absent).
|
|
29
|
+
|
|
30
|
+
## 0.1.1 — 2026-04-23
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
- **Repository metadata** — `repository` field now points at the standalone `github.com/nomideusz/svelte-search` repo instead of the monorepo, so the npm package page links to the right place.
|
|
34
|
+
- **CHANGELOG included in tarball** — `CHANGELOG.md` is now part of the published package (0.1.0 shipped without it).
|
|
35
|
+
|
|
36
|
+
## 0.1.0 — 2026-04-23
|
|
37
|
+
|
|
38
|
+
Initial public release.
|
|
39
|
+
|
|
40
|
+
### Added
|
|
41
|
+
- **Search engine** — `createSearchEngine({ db, adapter, locale?, dialect? })` with synonym expansion, full-text search, trigram fuzzy fallback, score blending, quality gate, and primary/nearby relevance boundaries.
|
|
42
|
+
- **Dialect support** — `sqlite` (FTS5 `MATCH` + custom trigram tables) and `postgres` (`tsvector` + `pg_trgm`).
|
|
43
|
+
- **Schema adapter** — `SchemaAdapter` interface for mapping any DB schema to the engine's concepts (entities, trigrams, FTS, synonyms).
|
|
44
|
+
- **Indexer** — `createIndexer()` with `indexTrigrams()`, `reindexAllTrigrams()`, `rebuildFts()`, `checkFtsSync()`, `updateSearchVector()` (Postgres).
|
|
45
|
+
- **Query resolver** — `parseQuery()` classifies tokens into location / category / area / rest; `findMatchingArea()` and `findNearestLocationWithEntities()` helpers.
|
|
46
|
+
- **Geo helpers** — `haversineKm`, `walkingMinutes`, `boundingBox`, `formatDistance`, `formatWalkingTime`, `walkingRoute` (OSRM).
|
|
47
|
+
- **Normalization & similarity** — `normalize`, `stripDiacriticsGeneric`, `trigrams`, `trigramSimilarity`, `levenshtein`, `levenshteinSimilarity`, `isPostcode`, `hasGeoIntent`, `stripGeoIntent`, `stripStopWords`.
|
|
48
|
+
- **Polish locale** (`@nomideusz/svelte-search/locales/pl`) — diacritics, stop words and phrases, geo-intent patterns (`blisko mnie`, `niedaleko`, `w okolicy`, …), and nominative-form stemming.
|
|
49
|
+
- **Tracker** — `createTracker()` fire-and-forget analytics via `navigator.sendBeacon`, session ID in `sessionStorage`.
|
|
50
|
+
- **Types** — `SearchParams`, `SearchResult`, `SearchResponse`, `AutocompleteResult`, `SearchLocale`, `ResolverLookups`, `ResolverAction`, `TrackSearchEvent`, `DatabaseClient`, `SqlDialect`.
|
|
51
|
+
- 67 unit tests across core (geo, normalize, resolver) and the Polish locale.
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Bartosz Dymet
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Bartosz Dymet
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|