diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2023-03-01 13:22:03 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2023-03-01 13:22:03 +0100 |
commit | 5e60dee2915902be21cf2bd22df00f8256e2bca3 (patch) | |
tree | 4f34c0412fa8aa83812ea6ffe48c48ef7fe893e2 /postgres/french/install_dict.sh | |
parent | 6cf86374a48ab080f5dfd91ea53cd090a783744e (diff) | |
download | Ishtar-5e60dee2915902be21cf2bd22df00f8256e2bca3.tar.bz2 Ishtar-5e60dee2915902be21cf2bd22df00f8256e2bca3.zip |
Free text search: add french_archeo thesaurus config
Diffstat (limited to 'postgres/french/install_dict.sh')
-rwxr-xr-x | postgres/french/install_dict.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/postgres/french/install_dict.sh b/postgres/french/install_dict.sh new file mode 100755 index 000000000..d8abfa098 --- /dev/null +++ b/postgres/french/install_dict.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +set -e + +MSG="install_dict.sh dbname [PG_SEARCH_DIR_PATH]" +if [ $# -eq 0 ]; then + echo $MSG + exit 1 +fi + +DB=$1 +PG_DIR=/usr/share/postgresql/13/ +PG_SEARCH_DIR="$PG_DIR"tsearch_data +if [ $# -eq 2 ]; then + PG_SEARCH_DIR=$2 +fi + +rm -f $PG_SEARCH_DIR/thesaurus_french_archeo.ths +ln -s `pwd`/thesaurus_french_archeo.ths $PG_SEARCH_DIR/ + +systemctl restart postgresql +touch /tmp/install_error +sudo -u postgres psql -d $1 -f create.sql > /dev/null 2> /tmp/install_error + +if grep ERR /tmp/install_error; then + exit 1; +fi + +echo '"french_archeo" dictionnary successfully installed for '$DB +echo 'Change your django local_settings.py file to add the line:' +echo 'ISHTAR_SEARCH_LANGUAGE = "french_archeo"' + |