When using the incategory: search the following fatal error occurs:
Fatal error: Call to a member function selectField() on a non-object in E:\usr\Apache2.2\htdocs\wiki\extensions\SphinxSearch\SphinxMWSearch.php on line 298
This can be solved by adding the following line to the start of the filterByCatelog function in SphinxMWSearch.php
$this->db = wfGetDB( DB_SLAVE );
The resulting function is as followings:
function filterByCategory( $matches ) {
$this->db = wfGetDB( DB_SLAVE );
$page_id = $this->db->selectField( 'page', 'page_id',
array(
'page_title' => $matches[ 3 ],
'page_namespace' => NS_CATEGORY
),
__METHOD__
);
$category = intval( $page_id );
if ( $matches[ 1 ] === '-' ) {
$this->exc_categories[ ] = $category;
} else {
$this->categories[ ] = $category;
}
return '';
}My Configuration:
Spinx 2.2.9
SphinxSearch MW Extension 0.9
MediaWiki 1.24.1