sphinx-setup.sh 781 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10
#!/bin/sh

SCRIPT=$(readlink -f "$0")
CWD=$(dirname "$SCRIPT")

# install sphinxsearch:
echo 'yes' | sudo add-apt-repository ppa:builds/sphinxsearch-daily
sudo apt-get update
sudo apt-get install sphinxsearch

11 12 13 14
# log files
sudo mkdir /var/log/sphinx
sudo touch /var/log/sphinx/searchd.log
sudo touch /var/log/sphinx/query.log
15 16 17 18 19
sudo chmod -R 777 /var/log/sphinx # ugly (for travis)

# spl dir
sudo mkdir /var/lib/sphinx
sudo chmod 777 /var/lib/sphinx # ugly (for travis)
20

21 22 23 24
# run dir pid
sudo mkdir /var/run/sphinx
sudo chmod 777 /var/run/sphinx # ugly (for travis)

25 26 27
# Setup source database
mysql -D yiitest -u travis < $CWD/../sphinx/source.sql

28 29 30 31 32
# setup test Sphinx indexes:
indexer --config $CWD/../sphinx/sphinx.conf --all

# run searchd:
searchd --config $CWD/../sphinx/sphinx.conf