From the course: Advanced PostgreSQL
Unlock this course with a free trial
Join today to access over 25,000 courses taught by industry experts.
Creating and using dictionaries - PostgreSQL Tutorial
From the course: Advanced PostgreSQL
Creating and using dictionaries
In PostgreSQL, you can further control how your search is performed using dictionaries. Dictionaries are used to eliminate words that should not be considered in a search such as stopwords. Dictionaries can also be used to normalize your words so that different derived forms of the same word will match. That is, they'll have the same root form. We've already discussed this earlier. A successfully normalized word stored in the tsvector representation is called a lexeme. Dictionaries can thus allow you to control which words you want to eliminate from search and which words you want to normalize to the same underlying form. Overall, dictionaries help improve the performance of your search. Let's take a look at a very simple example here. I'm going to create our own custom dictionary. I use the create text search dictionary command. The name of the dictionary that I've created is called public.simple_dict and the original template that the dictionary uses is the simple catalog from…
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
-
-
-
-