Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the possible values of regconfig in postgresql?

  1. http://www.postgresql.org/docs/9.3/static/textsearch-controls.html often refers to an optional regconfig parameter, but I can't find its possible values and their meanings. Where is it documented? If this can't be answered (e.g. because it depends on my installed database-components or like), how can I determine it myself?

  2. I'd like a "plain text" regconfig, without any human-language transformation. What is the argument for it?

like image 791
Lerin Sonberg Avatar asked Dec 26 '13 11:12

Lerin Sonberg


2 Answers

A text search configuration is a grouping of configuration objects: parsers, templates, and dictionaries. As far as I can tell the only configuration choices built-in are the language-specific ones like 'english' or 'finnish'.

You can see a list of configurations in your database via the \dF command in the psql command line tool, or via a query: select * from pg_catalog.pg_ts_config;

Regarding a "plain text" configuration (#2), I'm not sure what you need but look at creating a custom dictionary. Perhaps start with the built-in "simple" dictionary and remove the stop words? COMMENT ON TEXT SEARCH DICTIONARY simple IS 'simple dictionary: just lower case and check for stopword';

Reference: Configurations

like image 165
slothbear Avatar answered Sep 20 '22 12:09

slothbear


The blog article Mastering PostgreSQL Tools: Full-Text Search and Phrase Search answers your question in full.

To summarize:

The regconfig is the Search Configuration object which is, itself, a collection of templates, parser dictionaries and stopwords. You can find it using the command \dF. To find out more about a particular regconfig, such as english/dutch use the command \dF+ dutch

For setting up own regconfig, you'll need access to the postgres.conf file, which isn't always allowed.

like image 22
Vibhor Verma Avatar answered Sep 17 '22 12:09

Vibhor Verma