Agora
Search

Search

Three search modes — portable ILIKE (default), Postgres tsvector full-text search (keyword matching), and pgvector embedding-similarity ordering. What each does and when to reach for it.

The library ships three search modes. They are distinct mechanisms — pick by what you're matching.

ModeInputMatchesConfig
ILIKE (default)a text termsubstring across searchable columnssearchable: [...]
Full-text searcha text termkeyword/lexeme match against a tsvector documentfullText: {...}
Vector similaritya query embeddingnearest rows by embedding distancevectorSimilarity: {...}

Full-text search ≠ vector similarity

These two are easy to confuse — pgvector names its extension "vector", and plenty of prose calls tsvector search "vector search" too. They are not the same:

  • Full-text search (applyFullTextSearch) is keyword search — it matches a user's text query string against a Postgres tsvector document with websearch_to_tsquery / @@. Input: words.
  • Vector similarity (applyVectorSimilarity) is embedding-similarity ordering — it ranks rows by distance between a stored embedding column and a query embedding vector (pgvector <=>/<->/<#>). Input: a numeric vector.

Keyword-in-text → full-text. Semantic "most similar to this embedding" → vector similarity. They are additive and can be combined (filter by keywords, rank by embedding).

The search term routing

The request's free-text search term routes to one text path, decided by the policy:

  • Policy declares fullText → the term goes through tsvector full-text search.
  • Otherwise, if searchable is set → the term goes through the portable ILIKE scan (OR-combined across the columns).

The ILIKE default is covered under Filter Classes and Getting Started; the two advanced modes have their own pages:

On this page