I'm trying to implement multilingual indexes for the web application I'm developing. At the moment, records exist in a few languages, English, Malay & Arabic (but they are not separated into different columns). Only English stemmer is currently enabled.
Only two indexes are built, for the stemmed and the non-stemmed indexes. I'm having the problem with the stemmed index, as the result set returned is not consistent, depending on the sort column.
These two queries (from the stemmed index), each returns a different number of total results, although the difference between them is only the sort order.
SELECT * FROM test1stemmed WHERE MATCH('@institution universiti') GROUP BY art_id ORDER BY art_title_ord ASC;
SELECT * FROM test1stemmed WHERE MATCH('@institution universiti') GROUP BY art_id ORDER BY art_title_ord DESC;
However, if the same queries were run on the non-stemmed index, the numbers of results are equal.
I'm also having the same problem with Sphinx PHP API:
$sp = new SphinxClient();
$sp->SetServer('localhost', 9312);
$sp->SetMatchMode(SPH_MATCH_EXTENDED);
$sp->SetGroupBy('art_id', SPH_GROUPBY_ATTR, "$sp_sort_column $sort");
$sp->SetLimits($offset, $rows_per_page, 1000);
$sp->Query("$q", 'test1stemmed');
What am I missing?