pg-smart-search
FAQ

Frequently Asked Questions

Common questions and answers about pg-smart-search, performance, and architecture.

Frequently Asked Questions

Do I need ElasticSearch anymore?

For 95% of standard search use cases (text search, typo tolerance, filtering) up to 10M rows, PostgreSQL with this SDK is faster and drastically cheaper. You only need ES if you require complex aggregations or faceted navigation on petabytes of data.



Will this lock my database?

No. The Zombie Query Prevention mechanism uses AbortController. If a fast strategy resolves, slow queries are immediately cancelled via AbortSignal, freeing up DB connections and preventing table locks.



How does it handle typos?

It uses a Smart Hybrid Fallback. If standard FTS fails, it falls back to Trigram fuzzy matching, which natively handles misspellings. It also handles keyboard layout errors (e.g., typing Russian on an English layout) using ISO 9 standardization.



Does it support semantic search (RAG)?

Yes. By installing the pgvector extension and configuring OpenAI/Gemini API keys, the engine can perform vector similarity searches alongside traditional text searches.



Is it safe against SQL Injection?

Absolutely. The engine uses parameterized queries for all values and a strict SqlSanitizer whitelist for SQL identifiers (tables, columns). Dynamic filter keys are also strictly validated against the configuration.