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.
Este exercício faz parte do curso
Functions for Manipulating Data in PostgreSQL
Instruções do exercício
- Select the
titleanddescriptioncolumns from thefilmtable. - Perform a full-text search on the
titlecolumn for the wordelf.
Exercício interativo prático
Experimente este exercício completando este código de exemplo.
-- Select the title and description
SELECT ___, ___
FROM film
-- Convert the title to a tsvector and match it against the tsquery
WHERE ____(___) ___ ___(___);