Extension talk:SphinxSearch/LQT Archive 1

Major failures -- help!
Line #s 304 and 305 error out on SphinxSearch_body.php in version 1.8 of Mediawiki. Either i need to comment it out or upgrade to v1.11

Even after upgrading line # 171 errors with Fatal error: Call to undefined method SphinxClient::SetFilter in C:\wamp\www\wiki\extensions\SphinxSearch_body.php on line 171

Commenting doesn't help since it gives me a "Fatal error on the DB" or something like that. I'm thinking i need to install some package, but don't know which one (something in PEAR?)

Help :(


 * It looks like you are running this extension on Windows. To the best of my knowledge, this extension has not been tried as such yet. But, at least in theory, there is nothing that should prevent it from working. Of course, the big differences are all path related. So, let's first start by making sure your setup is correct. Were you successfully able to perform step 3, step 4, and step 5? Can you also please verify that step 7 was done correctly and you have the sphinxapi.php file in your C:\wamp\www\wiki\extensions\ directory? --Gri6507 12:20, 17 October 2007 (UTC)


 * I kinda solved this; upgrading to v1.11 off course takes care of the lines 304 & 305. As for the setFilter method, apparently the rc1 of sphinxapi doesn't have this method. I'm trying to copy-paste the method into my API as first option and then will try and build the current non-production API. Will keep you informed


 * Thanks for looking into this. I am running my installation with MW 1.9.3 and I don't know which version Svemir (the other developer) is running. I will start a new section on the main page with information about known supported MW versions. As for sphinxapi.php being incorrect, I am assuming you are using v0.9.8rc1? Both Svemir and I based this extension on 0.9.7 (the latest stable release). We'll keep a keen eye on the Sphinx project to make sure that our extension will be completely compatible with future version of Sphinx.


 * On a side note, I was wondering if you have implemented the windows equivalent of setting up the cron jobs to keep the indexes up to date. If you have, can you please add that information to the documentation? We would much appreciate it! --Gri6507 12:36, 18 October 2007 (UTC)


 * I'm still stuck and couldn't get much progress. Apparently the line
 * $sql = "SELECT old_text FROM ".$db->tableName('text')." WHERE old_id=".$docinfo['attrs']['old_id']; ends up with the value of $sql being Select old_text from 'text' where old_id=


 * I'm not sure why in the first place text is in single quotes (looks like some bug to me) and why the old_id is not getting picked up. Searchd does show the hit coming to it, but it could failing because i'm using a hacked version of the API


 * Also to answer Gri6507's question, i'm using 0.9.6 rc1 because that's the one that has the windows binaries. I don't have Visual Studio or VC++ to compile from the source code, so even my step #2 (using latest version and compiling) is at hold.


 * Adding the Windows cron job shouldn't be too tough (my guess); but i'll try it and let you know -- ALl the above posts bought to you by the guy who had the so useful signature Help :


 * According to Sphinx's website, http://www.sphinxsearch.com/downloads/sphinx-0.9.7-win32-release.zip is a windows release of 0.9.7. Is there any reason you are not using it? --Gri6507 11:42, 19 October 2007 (UTC)

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)

Cleanup required
The step2 is confusing because Sphinx already comes with a config file -- it needs to be made more clear

Steps 1 to Step 9 is also not very proper. Decent headings would be nice.


 * I made the steps 2 and 9 a little more clear. Let us know if you have some additional suggestions. Svemir Brkic 12:39, 19 October 2007 (UTC)

Failed at step 7
Everything worked fine up to step 6

Having require_once( "$IP/extensions/SphinxSearch.php" ); in the localsettings.php brings up the following messages (PHP errLogFile)

PHP Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of [runtime function name]. If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in E:\- Daten -\- MyWebSite -\HydroWiki\extensions\SphinxSearch.php on line 88

and

PHP Fatal error: Cannot redeclare class UnlistedSpecialPage in  wikiroot\includes\SpecialPage.php on line 703

Can you furthermore comment on $wgSphinxSearch_index = "wiki"; Has it to be replaced by the sphinx.conf file or by one of the generated indexes?


 * The original code used a pass-by-reference in one place. This been fixed in recent versions. $wgSphinxSearch_index needs to have the name of one of the generated indexes, as specified by a line such as "index wiki {" in the sphinx.conf file. Svemir Brkic 12:32, 5 October 2007 (UTC)

Alternative version
Modified version of this extension is currently in use at the New World Encyclopedia. Changes are explained at the above link and all the source files are linked from there too. Feel free to comment/use any of the code and let me know if I am not attributing somebody properly. Thanks. Svemir Brkic 03:35, 5 October 2007 (UTC)

Version 0.3 of our modified extension is available at the above link. We have further changed the main sphinx.conf query to use page_id as the primary document key. This avoids duplicate results when incremental indexing is used. Svemir Brkic 01:22, 8 October 2007 (UTC)
 * This version has merged with this extension starting with v0.3. --Gri6507 21:58, 12 October 2007 (UTC)