Full-Text Predicates

A predicate is a logical construct that returns TRUE or NOT TRUE. (I'll avoid FALSE here because of the issues related to three-value logic.) In SQL, these usually take the form of functions and reside in the WHERE clause. LIKE and EXISTS are examples of WHERE clause predicates.

When full-text searching is enabled, two additional predicates are available in Transact-SQL: CONTAINS and FREETEXT. CONTAINS provides support for both exact and inexact string matches, searches based on word proximity, word inflection searches, and weighted searches. FREETEXT, by contrast, is used to find words or phrases with the same basic meaning as those in the search term.

Before we begin exploring these functions via code, let's enable full-text ...

Get Guru's Guide to SQL Server Architecture and Internals, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.