0
0
PostgreSQLquery~10 mins

Search configuration and languages in PostgreSQL - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a text search configuration using the English dictionary.

PostgreSQL
CREATE TEXT SEARCH CONFIGURATION my_config ( COPY = [1] );
Drag options to blanks, or click blank then click option'
Aenglish
Bsimple
Cfrench
Dgerman
Attempts:
3 left
💡 Hint
Common Mistakes
Using a dictionary for a different language than intended.
Misspelling the dictionary name.
2fill in blank
medium

Complete the code to add a mapping for the 'asciiword' token to use the 'english_stem' dictionary.

PostgreSQL
ALTER TEXT SEARCH CONFIGURATION my_config ALTER MAPPING FOR asciiword WITH [1];
Drag options to blanks, or click blank then click option'
Afrench_stem
Bsimple
Cenglish_stem
Dgerman_stem
Attempts:
3 left
💡 Hint
Common Mistakes
Using a dictionary for a different language.
Forgetting to specify the correct dictionary name.
3fill in blank
hard

Fix the error in the code to set the default text search configuration to 'my_config'.

PostgreSQL
SET default_text_search_config = [1];
Drag options to blanks, or click blank then click option'
A'english'
B'simple'
Cmy_config
D'my_config'
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting quotes around the configuration name.
Using the wrong configuration name.
4fill in blank
hard

Fill both blanks to create a text search dictionary using the 'snowball' template for the French language.

PostgreSQL
CREATE TEXT SEARCH DICTIONARY my_french_dict ( TEMPLATE = [1], Language = [2] );
Drag options to blanks, or click blank then click option'
A'snowball'
B'english'
C'french'
D'simple'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing template and language values.
Using the wrong language name.
5fill in blank
hard

Fill all three blanks to create a text search configuration that copies from 'pg_catalog.english', alters the mapping for 'word' tokens to use 'my_french_dict', and sets it as default.

PostgreSQL
CREATE TEXT SEARCH CONFIGURATION my_french_config ( COPY = [1] );
ALTER TEXT SEARCH CONFIGURATION my_french_config ALTER MAPPING FOR word WITH [2];
SET default_text_search_config = [3];
Drag options to blanks, or click blank then click option'
Apg_catalog.english
Bmy_french_dict
C'my_french_config'
D'english'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting quotes around string literals.
Using dictionary names with quotes in mapping.
Setting default config without quotes.