|
| 1 | +# pg_tsparser - parser for text search |
| 2 | + |
| 3 | +## Introduction |
| 4 | + |
| 5 | +The **pg_tsparser** module is the modified default text search parser from |
| 6 | +PostgreSQL 9.6. |
| 7 | + |
| 8 | +## License |
| 9 | + |
| 10 | +This module available under the same license as |
| 11 | +[PostgreSQL](http://www.postgresql.org/about/licence/). |
| 12 | + |
| 13 | +## Installation |
| 14 | + |
| 15 | +Typical installation procedure may look like this: |
| 16 | + |
| 17 | + $ cd pg_tsparser |
| 18 | + $ sudo make USE_PGXS=1 install |
| 19 | + $ make USE_PGXS=1 installcheck |
| 20 | + $ psql DB -c "CREATE EXTENSION pg_tsparser;" |
| 21 | + |
| 22 | +After this you can create your own text search configuration: |
| 23 | + |
| 24 | +```sql |
| 25 | +CREATE TEXT SEARCH CONFIGURATION russian_ts ( |
| 26 | + PARSER = tsparser |
| 27 | +); |
| 28 | + |
| 29 | +COMMENT ON TEXT SEARCH CONFIGURATION russian_ts IS 'text search configuration for russian language'; |
| 30 | + |
| 31 | +ALTER TEXT SEARCH CONFIGURATION russian_ts |
| 32 | + ADD MAPPING FOR email, file, float, host, hword_numpart, int, |
| 33 | + numhword, numword, sfloat, uint, url, url_path, version |
| 34 | + WITH simple; |
| 35 | + |
| 36 | +ALTER TEXT SEARCH CONFIGURATION russian_ts |
| 37 | + ADD MAPPING FOR asciiword, asciihword, hword_asciipart |
| 38 | + WITH russian_stem, english_stem; |
| 39 | + |
| 40 | +ALTER TEXT SEARCH CONFIGURATION russian_ts |
| 41 | + ADD MAPPING FOR word, hword, hword_part |
| 42 | + WITH russian_stem, russian_stem; |
| 43 | +``` |
0 commit comments