Tokenization
Raw product text is broken into searchable linguistic tokens.
V2 replaces raw substring matching with PostgreSQL
full-text search using tokenization, lexemes,
stemming, weighted fields, tsquery,
relevance ranking and contextual headlines.
Enter a query to inspect full-text matching, ranking, application performance and the database execution plan.
Raw product text is broken into searchable linguistic tokens.
Words are normalized so related forms can map toward common searchable terms.
Matching products receive relevance scores
using ts_rank_cd().
Something went wrong while executing the query.
Human-readable interpretation of
EXPLAIN ANALYZE.
Execution information will appear here after a search.
Time PostgreSQL spent constructing the execution strategy.
Server-side time reported by PostgreSQL.
Rows inspected but rejected by the full-text filter.
Pages obtained from PostgreSQL's shared buffer cache.
Time until the selected node produced its first result.
Time until the selected node completed its work.
@@.
ts_rank_cd().
V2 transforms raw product fields into weighted searchable lexemes.
Name matches contribute most strongly to ranking.
Strong metadata signals about what the product is.
Associated terms contribute to relevance with lower weight.
Description matches remain valid but contribute less to ranking.
Compare architectural and runtime changes across implemented search versions.
| Version | Strategy | Results | App time | DB execution | Peak memory | Scan |
|---|---|---|---|---|---|---|
| V1 | LIKE / ILIKE | — | — | — | — | — |
| V2 | PostgreSQL FTS | — | — | — | — | — |
Products are ordered by
ts_rank_cd() relevance.
V2 improves search semantics, not yet retrieval efficiency.
V1 compares raw character sequences. V2 converts text into normalized linguistic terms before matching.
to_tsvector('english', text)
User input is converted with
websearch_to_tsquery(),
enabling normal words, quoted phrases,
OR and exclusions.
"gaming keyboard" -wireless
Matching products are no longer merely true or false. PostgreSQL calculates a relevance score.
ts_rank_cd(vector, query)
V2 intentionally constructs
tsvector values during the
query. A dedicated GIN index arrives in
V3.
V2 → linguistic, unindexed
PostgreSQL now understands words better, but without a full-text index it may still inspect large portions of the product table.
Scan product
→
Construct tsvector
→
Evaluate @@
→
Rank match
This separation is intentional: V2 measures the semantic improvement, while V3 will measure the effect of adding an inverted GIN index.