Skip to main content

Text Search Database

Controlled node

Overview

The Text Search Database node performs full-text searches on PostgreSQL database tables using text search vectors (tsvector). This node enables powerful text matching capabilities including plain text search, boolean logic, phrase matching, and web search syntax.

Unlike the Vector Search Database node which uses embeddings, this node uses traditional full-text search indexes. The target column must be a tsvector type column containing pre-computed text search vectors.

Query Types

The node supports four different query types to match your search needs:

Query TypeDescriptionExample Query
PlainSimple word matching with stemmingrunning shoes matches "run", "running", "shoe", etc.
BooleanSupports AND, OR, NOT operatorsrunning AND (shoes OR boots) NOT sandals
PhraseExact phrase matching"running shoes" matches only that exact phrase
Web SearchGoogle-style search syntaxrunning shoes -sandals or "exact phrase"

Language Support

The node supports 28+ languages for proper stemming and stop word handling:

LanguageCodeLanguageCode
SimplesimpleEnglishenglish
ArabicarabicArmenianarmenian
BasquebasqueCatalancatalan
DanishdanishDutchdutch
FinnishfinnishFrenchfrench
GermangermanGreekgreek
HindihindiHungarianhungarian
IndonesianindonesianIrishirish
ItalianitalianLithuanianlithuanian
NepalinepaliNorwegiannorwegian
PortugueseportugueseRomanianromanian
RussianrussianSerbianserbian
SpanishspanishSwedishswedish
TamiltamilTurkishturkish
Preparing Your Database

To use this node, your database table must have a column of type tsvector containing the text search vectors. Use the Get Text Search Vectors node to generate these vectors from text data, or create them directly in your database using PostgreSQL's to_tsvector() function.

Inputs

InputTypeDescriptionDefault
RunEventTriggers the text search operation.-
Database IDDataThe ID of the project database to search.-
Table IDDataThe name of the table within the database.-
Column IDDataThe name of the tsvector column to search against (e.g., content_vector, search_vector).-
QueryDataThe search query text. Supports different syntax based on Query Type.-
LimitNumberMaximum number of results to return.10
LanguageEnumThe language for stemming and stop word processing.english
Query TypeEnumThe type of search to perform: plain, tsquery (Boolean), phrase, or websearch.plain

Outputs

OutputTypeDescription
DoneEventFires when the search operation completes successfully.
ResultDataAn array of matching rows from the database, ordered by relevance. Each row includes the original columns plus a rank score.

Runtime Behavior and Defaults

When the Run event fires, the node executes a full-text search query against the specified PostgreSQL database table. The search uses the @@ operator with the appropriate query parsing function based on the Query Type:

  • Plain: Uses plainto_tsquery() for simple word matching
  • Boolean: Uses to_tsquery() for advanced boolean logic
  • Phrase: Uses phraseto_tsquery() for exact phrase matching
  • Web Search: Uses websearch_to_tsquery() for Google-style syntax

The node returns up to Limit rows (default: 10), ordered by text search relevance ranking. Results include all original row columns plus ranking information.

Important Requirements:

  • The target column must exist and be of type tsvector
  • The database must have the appropriate text search configuration installed for the selected language
  • Query syntax must match the selected Query Type (boolean operators only work with the "Boolean" type)

Example Usage

Here's a typical workflow for searching product descriptions:

  1. Connect a Start node to the Run input
  2. Set Database ID to your project database (e.g., prod_db_123)
  3. Set Table ID to your products table (e.g., products)
  4. Set Column ID to your text search vector column (e.g., description_vector)
  5. Connect a Text node to the Query input with search terms like wireless headphones
  6. Set Query Type to plain for simple word matching, or websearch for advanced queries
  7. Set Language to english (or the appropriate language for your content)
  8. Connect the Result output to a Show node or processing logic to display the matching products

Advanced Example with Boolean Logic:

  • Set Query Type to Boolean
  • Set Query to laptop AND (gaming OR business) NOT refurbished
  • This finds rows containing "laptop" and either "gaming" or "business", but excludes rows with "refurbished"