Spinx.conf for mediawiki

Problem:

[bash]ERROR: index ‘wiki_main’: sql_query: Table ‘db.page’ doesn’t exist (DSN=mysql://:***@localhost:3306/db)’[/bash]
[bash]ERROR: index ‘wiki_incremental’: sql_query: Table ‘db.page’ doesn’t exist (DSN=mysql://:***@localhost:3306/db)[/bash]

Solution:

This comes because in the database the tables being queried have a different name. The name was changed at the creation of the database. An example is the normal table for wiki is ‘page’ but now its ‘your_defined_prefix_page’. You will need to edit the sphinx.conf to call the right database tables. This should be fairly easy.

Before

[bash]# main document fetch query – change the table names if you are using a prefix
sql_query = SELECT page_id, page_title, page_namespace, page_is_redirect, old_id, old_text FROM page, revision, text WHERE rev_id=page_latest AND old_id=rev_text_id[/bash]

After

[bash]# main document fetch query – change the table names if you are using a prefix
sql_query = SELECT page_id, page_title, page_namespace, page_is_redirect, old_id, old_text FROM vn_page, vn_revision, vn_text WHERE rev_id=page_latest AND old_id=rev_text_id[/bash]

Leave a Reply

Your email address will not be published. Required fields are marked *