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

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