Precision Just Got an Upgrade in Snowflake: Meet the New PHRASE and EXACT Options

Precision Just Got an Upgrade in Snowflake: Meet the New PHRASE and EXACT Options

1 December | 2 min read

Snowflake just rolled out two powerful updates to the SEARCH() function — PHRASE and EXACT — and they’re a major step forward for anyone dealing with unstructured text.

If you’ve ever stitched together LIKE statements or fought with regex to track down the right data, this is your moment.

1. PHRASE Functionality – Precision Without Overcomplication

The new PHRASE mode ensures that results only appear when all tokens are found together and in the correct order.

Let’s say you’re auditing change logs across environments and want to locate records where someone updated an API key. You can now run:

SEARCH(change_comment, ‘updated api key’, SEARCH_MODE => ‘PHRASE’)

Snowflake will return only entries where that exact phrase appears — not every comment that just happens to include “updated” and “key” somewhere else.
Simple, direct, and context aware.

2. EXACT Functionality – When You Need an Identical Match

EXACT mode builds on PHRASE, adding one more layer of control: it requires delimiters (spaces, punctuation, symbols) to match exactly.

This is perfect when you’re validating identifiers, URLs, or version strings.

Example:

SEARCH(config_value, ‘api/v2/user-profile’, SEARCH_MODE => ‘EXACT’)

That will only match the precise path api/v2/user-profile — not variations like api/v2/user_profile (with an underscore) or api/v3/user-profile.
When precision matters — like reconciling configuration changes or validating data lineage — this feature saves hours of cleanup.

Why It Matters

Until now, Snowflake’s text search modes — OR and AND — worked well for broad matching but weren’t designed for phrase-level precision.

With PHRASE and EXACT, you can now query language the same way you read it: as sequences that carry meaning.
You get cleaner, more dependable results — without diving into the complexity of regex or keyword juggling.

Real-World Example: Data Auditing Simplified

Imagine a table of deployment notes. You could now find all deployments that explicitly mention a version upgrade:

SELECT *
FROM deployment_notes
WHERE SEARCH(note, ‘upgraded to version 3.5’, SEARCH_MODE => ‘PHRASE’);

That’s laser-focused — it won’t pull unrelated notes like “version check failed” or “rollback to 3.5 planned”.
It gives you exactly what you meant, instantly.

The Takeaway

With PHRASE and EXACT, Snowflake has made text search as intuitive as it should be — human, flexible, and accurate.
Whether you’re mining audit trails, analyzing user input, or validating system configurations, you can now search your data with confidence.

Leave a Comment

Your email address will not be published. Required fields are marked *

X