Basic full-text search
Searching text will become something you do repeatedly when building applications or exploring data sets for data science. Full-text search is helpful when performing exploratory data analysis for a natural language processing model or building a search feature into your application.
In this exercise, you will practice searching a text column and match it against a string. The search will return the same result as a query that uses the LIKE operator with the % wildcard at the beginning and end of the string, but will perform much better and provide you with a foundation for more advanced full-text search queries. Let's dive in.
Questo esercizio fa parte del corso
Functions for Manipulating Data in PostgreSQL
Istruzioni dell'esercizio
- Select the
titleanddescriptioncolumns from thefilmtable. - Perform a full-text search on the
titlecolumn for the wordelf.
Esercizio pratico interattivo
Prova a risolvere questo esercizio completando il codice di esempio.
-- Select the title and description
SELECT ___, ___
FROM film
-- Convert the title to a tsvector and match it against the tsquery
WHERE ____(___) ___ ___(___);