From the course: Advanced PostgreSQL
Unlock this course with a free trial
Join today to access over 24,700 courses taught by industry experts.
Performing a full-text search using the @@ operator - PostgreSQL Tutorial
From the course: Advanced PostgreSQL
Performing a full-text search using the @@ operator
You perform full text search in PostgreSQL using the double at operator. This operator allows you to match a query against a document and returns either true or false. True if the query is present. False if it is not. So you can specify the tsquery, then the double operator and then the tsvector or the other way round. tsvector first, then the double at and then the tsquery. Let's take a look at a simple query here. I search for the terms machine and learning represented using the tsquery format, and then I have the double at operator and I search for these terms within the document build and train simple machine learning models represented as a tsvector. That's what the colon colon tsquery, colon, colon, tsvector stands for. That will actually convert our query and vector into the tsquery and tsvector format respectively. When you execute this query, you'll get the result true. That's because the terms machine and learning are indeed present in our document. I'll now change the query…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Full-text search5m 30s
-
(Locked)
Basic text search using LIKE and ILIKE2m 27s
-
(Locked)
Tsvector and tsquery1m 56s
-
(Locked)
Performing a full-text search using the @@ operator2m 41s
-
(Locked)
Using logical operations in search terms2m 48s
-
(Locked)
Performing a search using a different language3m 11s
-
(Locked)
Controlling search parameters5m 3s
-
(Locked)
Ranking search results4m 11s
-
(Locked)
Creating and using dictionaries4m 17s
-
-
-
-