Concept Flow - @@ match operator
Input: Text Column, Query String
@@ Operator: Full Text Search Match
Evaluate: Does Text Match Query?
Return TRUE
The @@ operator checks if a text column matches a full-text search query, returning true or false.
SELECT title FROM articles WHERE content @@ to_tsquery('database & search');
| Step | Input Content | Query | @@ Evaluation | Result |
|---|---|---|---|---|
| 1 | 'Learn about database search techniques' | 'database & search' | TRUE | Row included |
| 2 | 'Introduction to cooking recipes' | 'database & search' | FALSE | Row excluded |
| 3 | 'Advanced database search indexing methods' | 'database & search' | TRUE | Row included |
| 4 | 'Gardening tips for beginners' | 'database & search' | FALSE | Row excluded |
| Exit | No more rows | Query ends |
| Variable | Start | After 1 | After 2 | After 3 | After 4 | Final |
|---|---|---|---|---|---|---|
| content | Learn about database search techniques | Introduction to cooking recipes | Advanced database search indexing methods | Gardening tips for beginners | ||
| query | database & search | database & search | database & search | database & search | ||
| @@ evaluation | TRUE | FALSE | TRUE | FALSE |
PostgreSQL @@ operator checks if a text column matches a full-text search query.
Syntax: column @@ to_tsquery('query')
Returns TRUE if the text matches the query, FALSE otherwise.
Use to_tsquery to format the search query.
Supports logical operators like & (AND), | (OR).
Useful for efficient text searching in large datasets.