pg-smart-search

Changelog

Release notes and version history for pg-smart-search.

Changelog

All notable changes to this project will be documented in this file.

[1.4.1] - 2026-06-24

Fixed

  • Session Pollution: Isolated active similarity thresholds (pg_trgm.word_similarity_threshold) using transaction-scoped SET LOCAL queries.
  • Robust Process Management: Replaced internal driver references with standardized SQL-based SELECT pg_backend_pid() calls.
  • Memory Security (OOM Guard): Extended MemoryCacheProvider with LRU eviction and maximum constraints (maxEntries: 10000).
  • Cache Eviction Cleanup: Added background sweep interval daemon in MemoryCacheProvider to free stale RAM assets.
  • Total Count Expressions: Suppressed heavy COUNT(*) OVER() window scans during deep keyset-linked page requests when skipTotalCount is active.
  • Cache Key Clashing: Implemented strict alphanumeric order sorting of query parameters before hashing keys.
  • Chronological Metrics: Patched sequence metrics array in MetricsCollector to output in strict chronological timeframe sequence.
  • Transactional Consistency: Integrated AbortSignal listeners internally within Active Transaction scopes.
  • Gemini Credentials Security: Moved client API keys from URL query arguments to x-goog-api-key headers to stop proxies logging plain text credentials.

Changed

  • DRY Refactoring: Extracted redundant filter syntax constructors and rows formatting loops into unified utility maps (result-mapper.ts).
  • Static Keyboards Mapping: Replaced dynamic hash generations inside keyboard translator (convertLayout) with pre-calculated key maps.
  • Instance Caching: Cached Strategy classes internally to avoid garbage collection stress on query-time allocations.
  • Latency Buffers: Upgraded collector buffer mechanics to use $O(1)$ ring buffer logic over flat arrays.
  • Cache Hit Logic: Refactored writing rules to save pages if total > 0 OR data.length > 0 (keeps caching active when skipTotalCount is active).

[1.4.0] - 2026-06-10

Added

  • Database Scale Enhancements: Scaled query throughput to execute O(log N) lookup overhead over 10M+ datasets.
  • GiST/KNN Trigram Indices: Migrated fuzzy trigram scans to GiST arrays with KNN distance operator (<->) to enable database-backed fast sorting.
  • FTS Ranking Speedup: Replaced positional ts_rank_cd logic with ts_rank to cut FTS retrieval cold latencies by 20-30%.
  • Parallel Search Execution: Implemented direct Promise.race FTS and standard search query scheduling.
  • Active Zombie Suppression: Enabled on-the-fly execution abortion of the slower search branch via backend connection cancellation signal (pg_cancel_backend).
  • Dedicated cancelPool: Spawned isolated backend connection pool (size 2-3) reserved strictly for cancel interrupts.
  • Automatic Generated Vectors: Changed manual data indexing workflows to use GENERATED ALWAYS AS ... STORED vectors, speeding up seeding up to 10x.

[1.3.1] - 2026-05-22

Added

  • skipTotalCount Parameter: Added config flag to omit heavy total records counts on target pages.

[1.3.0] - 2026-04-30

Added

  • Reliability System: Built-in health() checks, OOM protections (MAX_ROWS).
  • Redlock-style Cache Deduplication: Prevents cache stampedes in distributed environments.
  • Intelligent Rate-Limiting Queues: Uses p-queue for AI APIs (OpenAI/Gemini) to handle 429 errors gracefully.
  • True Zero-Freeze Networking: Native AbortController propagation ensures timeouts actually kill underlying fetch requests.
  • ISO 9 Compliance: Standardized Cyrillic-to-Latin transliteration for cross-language search reliability.
  • Monitoring & Metrics: Real-time tracking of cacheHitRate, dbLatency, and providerErrors via engine.metrics.

[1.2.1] - 2026-04-30

Fixed

  • Internal bug fixes and stability improvements.

[1.2.0] - 2026-04-30

Added

  • Keyset Pagination: High-performance cursor-based pagination support for massive result sets.
  • CLI Migration Suite: Automated interactive database setup and index migration tool (npm run init).

[1.1.1] - 2026-04-30

Fixed

  • Performance and formatting fixes for SQL queries.

[1.1.0] - 2026-04-30

Added

  • Enterprise Security: Parameterized queries, strict SqlSanitizer whitelist for identifiers, and injection-safe filter keys.

[1.0.0] - 2026-02-23

Added

  • Initial release.
  • Parallel Search Strategy (FTS + Trigram).
  • Smart Hybrid Fallback (Linguistic -> ILIKE -> Trigram).
  • Professional Caching (Memory and Redis providers).
  • Semantic Vector Search integration (OpenAI/Gemini via pgvector).