Friday, June 24, 2011

Installing SphinxSearch with libstemmer from FreeBSD ports

Environment: Sphinx 0.9, FreeBSD

Problem:
Sphinx port has libstemmer options commented out in Makefile. With automatic upgrades, it loses stemming for anything except for default EN and RU.

Procedure of rebuilding the port with libstemmer

# (become root)
cd /usr/ports/textproc/sphinxsearch


Create file Makefile.local with this line:
CONFIGURE_ARGS+= --with-libstemmer


make clean
make
fetch http://snowball.tartarus.org/dist/libstemmer_c.tgz
cd work/sphinx-*/
tar zxvf ../../libstemmer_c.tgz
cd ../..
make
make deinstall
make reinstall
make clean

Do not forget to rebuild index if you did not use libstemmer before