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 Type | Description | Example Query |
|---|---|---|
| Plain | Simple word matching with stemming | running shoes matches "run", "running", "shoe", etc. |
| Boolean | Supports AND, OR, NOT operators | running AND (shoes OR boots) NOT sandals |
| Phrase | Exact phrase matching | "running shoes" matches only that exact phrase |
| Web Search | Google-style search syntax | running shoes -sandals or "exact phrase" |
Language Support
The node supports 28+ languages for proper stemming and stop word handling:
| Language | Code | Language | Code |
|---|---|---|---|
| Simple | simple | English | english |
| Arabic | arabic | Armenian | armenian |
| Basque | basque | Catalan | catalan |
| Danish | danish | Dutch | dutch |
| Finnish | finnish | French | french |
| German | german | Greek | greek |
| Hindi | hindi | Hungarian | hungarian |
| Indonesian | indonesian | Irish | irish |
| Italian | italian | Lithuanian | lithuanian |
| Nepali | nepali | Norwegian | norwegian |
| Portuguese | portuguese | Romanian | romanian |
| Russian | russian | Serbian | serbian |
| Spanish | spanish | Swedish | swedish |
| Tamil | tamil | Turkish | turkish |
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
| Input | Type | Description | Default |
|---|---|---|---|
| Run | Event | Triggers the text search operation. | - |
| Database ID | Data | The ID of the project database to search. | - |
| Table ID | Data | The name of the table within the database. | - |
| Column ID | Data | The name of the tsvector column to search against (e.g., content_vector, search_vector). | - |
| Query | Data | The search query text. Supports different syntax based on Query Type. | - |
| Limit | Number | Maximum number of results to return. | 10 |
| Language | Enum | The language for stemming and stop word processing. | english |
| Query Type | Enum | The type of search to perform: plain, tsquery (Boolean), phrase, or websearch. | plain |
Outputs
| Output | Type | Description |
|---|---|---|
| Done | Event | Fires when the search operation completes successfully. |
| Result | Data | An 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:
- Connect a Start node to the Run input
- Set Database ID to your project database (e.g.,
prod_db_123) - Set Table ID to your products table (e.g.,
products) - Set Column ID to your text search vector column (e.g.,
description_vector) - Connect a Text node to the Query input with search terms like
wireless headphones - Set Query Type to
plainfor simple word matching, orwebsearchfor advanced queries - Set Language to
english(or the appropriate language for your content) - 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"