|
1 | 1 | CREATE EXTENSION hunspell_fr;
|
2 | 2 | CREATE TABLE table1(name varchar);
|
3 |
| -INSERT INTO table1 VALUES ('beau'), ('antérieur'), ('fraternel'), |
4 |
| - ('plaît'), ('comprends'), ('désolée'), |
5 |
| - ('cents'), ('grammairiens'), ('résistèrent'), |
6 |
| - ('derniers'), ('rapprochent'); |
7 |
| -SELECT ts_lexize('public.french_hunspell', name) FROM table1; |
8 |
| - ts_lexize |
9 |
| ------------------ |
10 |
| - {beau} |
11 |
| - {antérieure} |
12 |
| - {fraternelle} |
13 |
| - {plaire} |
14 |
| - {comprendre} |
15 |
| - {désoler} |
16 |
| - {cent} |
17 |
| - {grammairienne} |
18 |
| - {résister} |
19 |
| - {dernière} |
20 |
| - {rapprocher} |
21 |
| -(11 rows) |
| 3 | +INSERT INTO table1 VALUES ('batifoler'), ('batifolant'), ('batifole'), ('batifolait'), |
| 4 | + ('consentant'), ('consentir'), ('consentiriez'); |
| 5 | +SELECT d.* FROM table1 AS t, LATERAL ts_debug('public.french', t.name) AS d; |
| 6 | + alias | description | token | dictionaries | dictionary | lexemes |
| 7 | +-----------+-----------------+--------------+-------------------------------+-----------------+------------------------- |
| 8 | + asciiword | Word, all ASCII | batifoler | {french_hunspell,french_stem} | french_hunspell | {batifoler} |
| 9 | + asciiword | Word, all ASCII | batifolant | {french_hunspell,french_stem} | french_hunspell | {batifolante,batifoler} |
| 10 | + asciiword | Word, all ASCII | batifole | {french_hunspell,french_stem} | french_hunspell | {batifoler} |
| 11 | + asciiword | Word, all ASCII | batifolait | {french_hunspell,french_stem} | french_hunspell | {batifoler} |
| 12 | + asciiword | Word, all ASCII | consentant | {french_hunspell,french_stem} | french_hunspell | {consentante,consentir} |
| 13 | + asciiword | Word, all ASCII | consentir | {french_hunspell,french_stem} | french_hunspell | {consentir} |
| 14 | + asciiword | Word, all ASCII | consentiriez | {french_hunspell,french_stem} | french_hunspell | {consentir} |
| 15 | +(7 rows) |
22 | 16 |
|
23 | 17 | CREATE INDEX name_idx ON table1 USING GIN (to_tsvector('public.french', "name"));
|
24 |
| -SELECT d.* FROM table1 AS t, LATERAL ts_debug('public.french', t.name) AS d; |
25 |
| - alias | description | token | dictionaries | dictionary | lexemes |
26 |
| ------------+-------------------+--------------+-------------------------------+-----------------+----------------- |
27 |
| - asciiword | Word, all ASCII | beau | {french_hunspell,french_stem} | french_hunspell | {beau} |
28 |
| - word | Word, all letters | antérieur | {french_hunspell,french_stem} | french_hunspell | {antérieure} |
29 |
| - asciiword | Word, all ASCII | fraternel | {french_hunspell,french_stem} | french_hunspell | {fraternelle} |
30 |
| - word | Word, all letters | plaît | {french_hunspell,french_stem} | french_hunspell | {plaire} |
31 |
| - asciiword | Word, all ASCII | comprends | {french_hunspell,french_stem} | french_hunspell | {comprendre} |
32 |
| - word | Word, all letters | désolée | {french_hunspell,french_stem} | french_hunspell | {désoler} |
33 |
| - asciiword | Word, all ASCII | cents | {french_hunspell,french_stem} | french_hunspell | {cent} |
34 |
| - asciiword | Word, all ASCII | grammairiens | {french_hunspell,french_stem} | french_hunspell | {grammairienne} |
35 |
| - word | Word, all letters | résistèrent | {french_hunspell,french_stem} | french_hunspell | {résister} |
36 |
| - asciiword | Word, all ASCII | derniers | {french_hunspell,french_stem} | french_hunspell | {dernière} |
37 |
| - asciiword | Word, all ASCII | rapprochent | {french_hunspell,french_stem} | french_hunspell | {rapprocher} |
38 |
| -(11 rows) |
| 18 | +SELECT * FROM table1 WHERE to_tsvector('public.french', name) |
| 19 | + @@ to_tsquery('public.french', 'batifolant'); |
| 20 | + name |
| 21 | +------------ |
| 22 | + batifoler |
| 23 | + batifolant |
| 24 | + batifole |
| 25 | + batifolait |
| 26 | +(4 rows) |
| 27 | + |
| 28 | +SELECT * FROM table1 WHERE to_tsvector('public.french', name) |
| 29 | + @@ to_tsquery('public.french', 'consentiriez'); |
| 30 | + name |
| 31 | +-------------- |
| 32 | + consentant |
| 33 | + consentir |
| 34 | + consentiriez |
| 35 | +(3 rows) |
39 | 36 |
|
40 | 37 | DROP INDEX name_idx;
|
41 | 38 | CREATE INDEX name_idx ON table1 USING GIST (to_tsvector('public.french', "name"));
|
42 |
| -SELECT d.* FROM table1 AS t, LATERAL ts_debug('public.french', t.name) AS d; |
43 |
| - alias | description | token | dictionaries | dictionary | lexemes |
44 |
| ------------+-------------------+--------------+-------------------------------+-----------------+----------------- |
45 |
| - asciiword | Word, all ASCII | beau | {french_hunspell,french_stem} | french_hunspell | {beau} |
46 |
| - word | Word, all letters | antérieur | {french_hunspell,french_stem} | french_hunspell | {antérieure} |
47 |
| - asciiword | Word, all ASCII | fraternel | {french_hunspell,french_stem} | french_hunspell | {fraternelle} |
48 |
| - word | Word, all letters | plaît | {french_hunspell,french_stem} | french_hunspell | {plaire} |
49 |
| - asciiword | Word, all ASCII | comprends | {french_hunspell,french_stem} | french_hunspell | {comprendre} |
50 |
| - word | Word, all letters | désolée | {french_hunspell,french_stem} | french_hunspell | {désoler} |
51 |
| - asciiword | Word, all ASCII | cents | {french_hunspell,french_stem} | french_hunspell | {cent} |
52 |
| - asciiword | Word, all ASCII | grammairiens | {french_hunspell,french_stem} | french_hunspell | {grammairienne} |
53 |
| - word | Word, all letters | résistèrent | {french_hunspell,french_stem} | french_hunspell | {résister} |
54 |
| - asciiword | Word, all ASCII | derniers | {french_hunspell,french_stem} | french_hunspell | {dernière} |
55 |
| - asciiword | Word, all ASCII | rapprochent | {french_hunspell,french_stem} | french_hunspell | {rapprocher} |
56 |
| -(11 rows) |
| 39 | +SELECT * FROM table1 WHERE to_tsvector('public.french', name) |
| 40 | + @@ to_tsquery('public.french', 'batifolant'); |
| 41 | + name |
| 42 | +------------ |
| 43 | + batifoler |
| 44 | + batifolant |
| 45 | + batifole |
| 46 | + batifolait |
| 47 | +(4 rows) |
| 48 | + |
| 49 | +SELECT * FROM table1 WHERE to_tsvector('public.french', name) |
| 50 | + @@ to_tsquery('public.french', 'consentiriez'); |
| 51 | + name |
| 52 | +-------------- |
| 53 | + consentant |
| 54 | + consentir |
| 55 | + consentiriez |
| 56 | +(3 rows) |
57 | 57 |
|
0 commit comments