Once you have created your full-text indexes, you are ready to start using them in your queries. There are some special commands built into Transact-SQL that are specifically used in full-text searching. These are the special commands:
COMMAND
ACTION
CONTAINS
Allows you to search for specific words or phrases within the column(s) defined in the full-text index
FREETEXT
Searches for multiple, less precise words, phrases, or sentences. The full-text search engine extracts the important words out of the words.
CONTAINSTABLE
Specified in the FROM clause of a query, used as a table name that contains specific words and phrases.
The CONTAINSTABLE command returns two columns of values, Key and Rank. Key is the value for the key column in the index. This was specified when the index was created. Rank is the ranking of the search results.
FREETEXTTABLE
Specified in the FROM clause of a query, used as a table name that contains less precise words, phrases, or sentences.
The FREETEXTTABLE command returns two columns of values, Key and Rank. Key is the value for the key column in the index.
This was specified when the index was created. Rank is the ranking of the search results.
Let us look at some examples of the various commands in the SlideShow below. In each situation, the value in the Notes text column in the Employees table for EmployeeID 101 will be the following:
Free Text Query
In the next lesson, we will review the information covered in this module.