aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2021-01-07 02:09:19 +0100
committerJakub Jirutka <jakub@jirutka.cz>2021-01-07 02:14:22 +0100
commitecae56c3ebea84065c4dab537ea94cb1d8020398 (patch)
tree759f4aaf40034effd1f0238cb01943b997e9aae8
parentb2d915e44eb51cc3c206fcbb30a641d3468d3f00 (diff)
downloadaports-ecae56c3ebea84065c4dab537ea94cb1d8020398.tar.gz
aports-ecae56c3ebea84065c4dab537ea94cb1d8020398.tar.bz2
aports-ecae56c3ebea84065c4dab537ea94cb1d8020398.tar.xz
community/postgresql-tsearch-czech: update after adding czech_stem into postgresql
-rw-r--r--community/postgresql-tsearch-czech/APKBUILD9
-rw-r--r--community/postgresql-tsearch-czech/czech.stop88
-rw-r--r--community/postgresql-tsearch-czech/postgresql-tsearch-czech.post-install2
-rw-r--r--community/postgresql-tsearch-czech/tsearch_czech_create.sql23
4 files changed, 15 insertions, 107 deletions
diff --git a/community/postgresql-tsearch-czech/APKBUILD b/community/postgresql-tsearch-czech/APKBUILD
index a9f52f85b3..f7c4ca37d6 100644
--- a/community/postgresql-tsearch-czech/APKBUILD
+++ b/community/postgresql-tsearch-czech/APKBUILD
@@ -4,16 +4,14 @@ pkgname=postgresql-tsearch-czech
_projname=ispell_czech
pkgver=0_git20120119
_gitrev=0d7722677b1a5e485eb0813c96c4ab13ac5ec7b0
-pkgrel=1
+pkgrel=2
pkgdesc="Czech ispell dictionary (UTF-8) for fulltext search in PostgreSQL"
url="https://github.com/tvondra/ispell_czech"
arch="noarch"
license="GPL-3.0"
makedepends="perl"
install="$pkgname.post-install"
-# czech.stop is extracted from http://www.pgsql.cz/data/czech.tar.gz.
source="https://github.com/tvondra/ispell_czech/archive/$_gitrev/$pkgname-$_gitrev.tar.gz
- czech.stop
tsearch_czech_create.sql
"
builddir="$srcdir/$_projname-$_gitrev"
@@ -27,10 +25,9 @@ package() {
local pgshare="$pkgdir/usr/share/postgresql"
install -d "$pgshare"/tsearch_data
- install -m 644 -t "$pgshare"/tsearch_data/ czech.dict czech.affix "$srcdir"/czech.stop
+ install -m 644 -t "$pgshare"/tsearch_data/ czech.dict czech.affix
install -m 644 -t "$pgshare"/ "$srcdir"/tsearch_czech_create.sql
}
sha512sums="1adaad501b36408b8b05ad96a5c8c9e8e5cf1c6524a9ffb6c1fe0405c5d1dcce9ee3f332e83ea11e3a88e55d6978338400797f053cd8318702b3d0e46de02552 postgresql-tsearch-czech-0d7722677b1a5e485eb0813c96c4ab13ac5ec7b0.tar.gz
-b546898e326a426c4fde79ab04a93d9510a3d9a7c0330f8ce264ae8002e005cb8e9bfc9a978070fe5e291af9d82efd59826cbb31cd0bbafd554e035993aa130b czech.stop
-16b70a7de853909f949d9e7cbb2cf06f79da06dcbbdda1b5df99e43cd2710fda6f5451215b34d6c5bf405bedc18605d369bdcd326dcf5a189540b5f309726672 tsearch_czech_create.sql"
+112a0f38964184cbe24c073e6834b79c784c8d90f983f06447ec963d91804ab25730a2b740210e54e83479d3c8fa6f417909c540e90b4ebb89ce80f67f711fc6 tsearch_czech_create.sql"
diff --git a/community/postgresql-tsearch-czech/czech.stop b/community/postgresql-tsearch-czech/czech.stop
deleted file mode 100644
index d2c33858f5..0000000000
--- a/community/postgresql-tsearch-czech/czech.stop
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
-a
-ale
-ano
-atd
-by
-být
-co
-čí
-čím
-do
-i
-já
-jak
-je
-jeho
-jemu
-její
-jejich
-ji
-jí
-jim
-již
-jsem
-jsi
-jsou
-k
-kde
-kdo
-kdy
-který
-mě
-mém
-mne
-mně
-můj
-my
-na
-nad
-nám
-náš
-ne
-o
-on
-ona
-oni
-ono
-pak
-po
-pod
-pro
-proto
-proč
-před
-s
-se
-sem
-si
-svůj
-ta
-tady
-tak
-také
-tam
-tato
-teď
-ten
-ti
-tím
-to
-tobě
-tomu
-tvůj
-ty
-tyto
-u
-už
-v
-ve
-vám
-váš
-viz
-vy
-z
-za
-ze
-že
diff --git a/community/postgresql-tsearch-czech/postgresql-tsearch-czech.post-install b/community/postgresql-tsearch-czech/postgresql-tsearch-czech.post-install
index e9afeabf6c..968a237125 100644
--- a/community/postgresql-tsearch-czech/postgresql-tsearch-czech.post-install
+++ b/community/postgresql-tsearch-czech/postgresql-tsearch-czech.post-install
@@ -3,7 +3,7 @@
cat >&2 <<EOF
*
* Run as postgres user to create configuration for the Czech dictionary:
-* psql < /usr/share/postgresql/tsearch_czech_create.sql
+* psql -X < /usr/share/postgresql/tsearch_czech_create.sql
*
EOF
diff --git a/community/postgresql-tsearch-czech/tsearch_czech_create.sql b/community/postgresql-tsearch-czech/tsearch_czech_create.sql
index 0f70b7094e..802f657783 100644
--- a/community/postgresql-tsearch-czech/tsearch_czech_create.sql
+++ b/community/postgresql-tsearch-czech/tsearch_czech_create.sql
@@ -6,6 +6,7 @@
\set cfgname 'czech'
\set dictname 'czech_ispell'
+\set stemmer 'czech_stem' -- change to 'simple' if you don't have czech stemmer
\set namespace 'pg_catalog'
\out /dev/null
@@ -23,18 +24,16 @@ SELECT EXISTS (SELECT 1 FROM pg_ts_dict WHERE dictnamespace = :'namespace'::regn
\echo text search dictionary :"dictname" already exists in namespace :"namespace"
\else
\echo creating text search dictionary :"dictname" in namespace :"namespace"
- CREATE TEXT SEARCH DICTIONARY :"dictname" (template=ispell, dictfile = czech, afffile=czech, stopwords=czech);
+ CREATE TEXT SEARCH DICTIONARY :"dictname" (
+ template = ispell,
+ dictfile = czech,
+ afffile = czech,
+ stopwords = czech
+ );
\endif
--- Create TS configuration if not exists
+-- Update TS configuration
-SELECT EXISTS (SELECT 1 FROM pg_ts_config WHERE cfgnamespace = :'namespace'::regnamespace AND cfgname = :'cfgname') AS has_config;
-\gset
-
-\if :has_config
- \echo text search configuration :"cfgname" already exists in namespace :"namespace"
-\else
- \echo creating text search configuration :"cfgname" in namespace :"namespace"
- CREATE TEXT SEARCH CONFIGURATION :"cfgname" (copy=english);
- ALTER TEXT SEARCH CONFIGURATION :"cfgname" ALTER MAPPING FOR word, asciiword WITH :"dictname", simple;
-\endif
+\echo updating text search configuration :"cfgname" in namespace :"namespace"
+ALTER TEXT SEARCH CONFIGURATION :"cfgname"
+ ALTER MAPPING FOR asciiword, asciihword, hword, hword_asciipart, hword_part, word WITH :"dictname", :"stemmer";