Extension talk:SphinxSearch/LQT Archive 1

fails because trying to search non-existent table Zebee Johnstone 01:48, 26 September 2007 (UTC)
Set up as described, but the table names in the version I have, MediaWiki 1.11 are: +--+ +--+
 * Tables_in_wikidb |
 * mw_archive      |
 * mw_blobs        |
 * mw_brokenlinks  |
 * mw_categorylinks |
 * mw_cur          |
 * mw_hitcounter   |
 * mw_image        |
 * mw_imagelinks   |
 * mw_interwiki    |
 * mw_ipblocks     |
 * mw_links        |
 * mw_linkscc      |
 * mw_logging      |
 * mw_math         |
 * mw_objectcache  |
 * mw_old          |
 * mw_oldimage     |
 * mw_querycache   |
 * mw_recentchanges |
 * mw_searchindex  |
 * mw_site_stats   |
 * mw_user         |
 * mw_user_newtalk |
 * mw_user_rights  |
 * mw_validate     |
 * mw_watchlist    |

so it isn't finding "wiki-page" ERROR: sql_query: Table 'wikidb.wiki_page' doesn't exist (DSN=mysql://wikiuser:***@localhost:3306/wikidb).

So which of my tables are the equivalents you are searching?


 * I believe you are getting this error when trying to run the Sphinx indexer or search tools? If that's the case then you missed a step in the instructions. In step 2, when you create the sphinx.conf file, you need to make sure to replace all instances of wiki_ with whatever your table prefix is (in your case, it looks like mw_). That's what I was trying to explain the the text after the sphinx.conf content listing. Please let me know if I should rephrase that paragraph. --Gri6507 12:02, 26 September 2007 (UTC)

Improving the index and searching speed
First of all, thanks for a great new extension. Installation was a breeze. My only problem so far was the speed of the special page itself. Here is what I changed, making the indexer faster as well:

In the sphinx.conf file:

sql_query = SELECT old_id,old_text,page_id,page_title,page_namespace \ FROM `page`, `revision`, `text` \ WHERE old_id=rev_text_id AND rev_id=page_latest AND page_is_redirect=0
 * Replaced sql_query with:

sql_group_column = page_id
 * Added one more attribute to avoid complex joins in the search page:

sql_query_info = select old_text,page_title \ FROM `page`, `revision`, `text` \ WHERE rev_text_id=$id AND rev_page=page_id AND old_id=$id
 * Replace sql_query_info (note that is used only for command-line searches, not on the search page)

In SphinxSearch.php:


 * Find the foreach at about line 167 and replace the lines from "foreach... until "$wiki_path = Title::makeName($row[1], $row[2]);" with:

foreach ($res["matches"] as $doc => $docinfo) { $sql = "select old_text FROM `text` WHERE old_id=$doc"; $res = $db->query( $sql, __METHOD__ ); if ($db->numRows($res)) { $row = $db->fetchRow($res); $title_obj = Title::newFromID( $docinfo['attrs']['page_id'] ); $wiki_title = $title_obj->getText; $wiki_path = $title_obj->getDBkey;

Svemir Brkic 13:59, 26 September 2007 (UTC)