Last modified: 2014-03-10 09:18:22 UTC
When you have invalid data in the searchindex table, the maintenance script rebuildtextindex.php is there to fix that. However, this currently does not work: The script currently does only update the _SQL index_, not the _rows_ of the searchindex table. So rows, which should not be there (e.g. as they point to a deleted page), will _stay_(!) in the index. That way the index is created based on wrong data. rebuildtextindex.php should first rebuild the _actual table data_, before it recreates the SQL index (based on that data).
rebuildtextindex.php works correctly when you truncate the searchindex table before you run rebuildtextindex.php. Adding this step to rebuildtextindex.php should solve the issue.
Thanks for taking the time to report this! In case you are interested to provide a patch, see https://www.mediawiki.org/wiki/Developer_access