I have a single-field Sphinx index with stemming set up as follows:
index main_sphinxalert
{
# Options:
type = rt
path = /var/lib/sphinxsearch/data/main_sphinxalert
morphology = stem_en
# Fields:
rt_field = query
}
I then insert:
mysql> INSERT INTO main_sphinxalert VALUES(201,'tables');
Query OK, 1 row affected (0.00 sec)
And select:
mysql> SELECT * FROM main_sphinxalert WHERE MATCH('tables');
+------+--------+
| id | weight |
+------+--------+
| 201 | 1709 |
+------+--------+
1 row in set (0.00 sec)
But can't select on a stem:
mysql> SELECT * FROM main_sphinxalert WHERE MATCH('table');
Empty set (0.00 sec)
Can anyone tell me what gives?
Turns out Sphinx will not read modifications to config files for a realtime index after it's been created: see here for info.
The way around this is to:
sudo service sphinxsearch stop
Then delete all index files (for me held in /var/lib/sphinxsearch/data/
):
sudo rm main_sphinxalert.*
Then restart service:
sudo service sphinxsearch start
This means you lose your existing index, which will then have to be manually rebuilt from your database.