From a955916690a9708bdd449c797f7f1b2b09c36529 Mon Sep 17 00:00:00 2001 From: Jack Stdin Date: Mon, 15 Feb 2016 01:15:34 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=20readme=20(=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8?= =?UTF-8?q?=20=D1=81=20pg=5Ftrgm,=20=D0=BD=D0=B0=D1=87=D0=B0=D0=BB=D1=8C?= =?UTF-8?q?=D0=BD=D0=B0=D1=8F=20=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9?= =?UTF-8?q?=D0=BA=D0=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 707360d..7e2e80e 100644 --- a/README.md +++ b/README.md @@ -50,16 +50,17 @@ _Внимание_! Только Python 2.7, только PostgreSQL, тольк sudo apt-get update sudo apt-get install postgresql-9.5 ``` - Затем создайте пользователя и базу данных: + Затем создайте пользователя и базу данных и установите расширение pg_trgm: ``` sudo adduser phias sudo -u postgres psql - postgres=# CREATE EXTENSION pg_trgm; - postgres=# CREATE EXTENSION btree_gin; postgres=# CREATE DATABASE fias_db; postgres=# CREATE USER phias WITH password 'phias'; postgres=# GRANT ALL privileges ON DATABASE fias_db TO phias; postgres=# ALTER USER phias WITH SUPERUSER; + postgres=# \q + postgres=# sudo -u phias psql -d fias_db -U phias + postgres=# CREATE EXTENSION pg_trgm SCHEMA public; ``` 3. Sphinx 2.2.1 и новее: @@ -124,4 +125,12 @@ _Внимание_! Только Python 2.7, только PostgreSQL, тольк cd /var/www sudo -u phias -H git clone --branch=master https://github.com/jar3b/py-phias.git py-phias sudo pip install -r requirements.txt - ``` \ No newline at end of file + ``` + +## Настройка +1. Создадим базу: +`sudo -u phias python manage.py -b create -s /tmp/fias_xml.rar` +2. Проиндексируем Sphinx + `sudo python manage.py -c -i indexer -o /usr/local/sphinx/etc/sphinx.conf` + Затем запустим searchd + `sudo searchd --config /usr/local/sphinx/etc/sphinx.conf`