Extension talk:Zend Search Lucene for MediaWiki



PslZendSearchLuceneIndexer.php and Windows

Under Windows we had to maintain directories with a double slash "\\" otherwise an error message would appear.

$wikisArray[0]['maintenanceScript'] = "...\\maintenance\\dumpBackup.php";
...
private $PhpExecutionStringWindows  = "...\\php\\php.exe";

MWJames 02:01, 24 February 2011 (UTC)

Sure, I wrote this under Windows and deployed it on Unix. The examples are obviously mixed :-). Steviex2 06:39, 24 February 2011 (UTC)

PslZendSearchLuceneIndexer.php, Full update vs. Incremental update?

As for now PslZendSearchLuceneIndexer.php will always initiate a full index update which cost immense system resources and takes an amount of time to be finished. Is their are a way, PslZendSearchLuceneIndexer.php has an incremental update modus, so that updates can be scheduled on regularly (incremental) basis and full updates only on special occasions? MWJames 03:00, 24 February 2011 (UTC)

I noticed in my environment, that incremental update takes more time then a full update, however you can set
"private $incrementUpdate" to true. Steviex2 06:35, 24 February 2011 (UTC)
There is coming an update with an easy to edit config file for the Lucene Indexer. It also provides an admin-UI for manually reindexing in full and incremental mode and a config var called $wgPslZslAdminUseAutoReIndex, which will cause reindexing on article save events.
count on it...coming within the next few days :-). Steviex2 04:44, 1 April 2011 (UTC)

Special:PslZendSearchLucene, the url api and non-display of redirects?

We recognized that while using ($wgSearchType = 'PslZendSearchLucene') as standard search with the cost of a large performance drop in comparison with the standard MW search (same search term with MW search (under 2 sec.) Zend Search over 1 min.) but we would consider Zend Search as additional search option. We found that the Special Page can be used with an url api option. P

{{fullurl:Special:PslZendSearchLucene|query= " search term" &PslSearchMode=2}}

Is their a possibility to have an option that redirects are not shown in the result display, similar to the search options (PslSearchMode=1 or 2 or 3)? MWJames 05:33, 24 February 2011 (UTC)

I wrote this plugin mainly for a customer. There we have server with many different MediaWiki-instances. Every Wiki has ~ 4000 Lucene documents. Till now we recognized no performance issues. And yes there is always a possibility to add more options, it's OOP and Open Source :-). I have some other ToDos first (see main page). Steviex2 06:28, 24 February 2011 (UTC)

Special:PslZendSearchLucene, problems with display of Japanese/Chinese !

We are using English, Chinese and Japanese page content, and while the standard MW search and display works in the correct manner, Zend Search brings a error message and does not display the result in the correct character codding.

Warning: Cannot modify header information - headers already sent by (output started at
 ...extensions\PslZendSearchLucene\PslZendSearchLucene_body.php:452) 

MWJames 05:46, 24 February 2011 (UTC)

Hi MWJames,
it currently supports UTF-8, english and german (positive tested, see main page). Steviex2 06:18, 24 February 2011 (UTC)
@Steviex2: I am testing PslZendSearchLucene-Extension (Version 2.0) with MediaWiki 1.16.4, PHP 5.2.6 and MySQL 5.0.51. The Wiki's content is written in german language, but unfortunately I also receive the following error message (presumably based on coding issues):
Notice: iconv_strlen() [function.iconv-strlen]: Detected an illegal character in input string in {Server-Path}/ZendFramework-1.11.6/library/Zend/Search/Lucene/Search/QueryLexer.php on line 342
Is there any known solution for this problem yet? Grüße! Agoerlt 15:18, 17 May 2011 (UTC)
Hi,
could you please mention the extension version you are using and the full error message. Steviex2 15:33, 17 May 2011 (UTC)
Its Version 2.0 of the extension and except for "{Server-Path}" the full error message (compare my post). Agoerlt 16:01, 17 May 2011 (UTC)
I' m not really sure- but believe that I read something about it while developing, maybe in conjunction with the used zend framework version or the iconv-configuration in php.ini. There are several german wikis in use with this extension (in production mode)- never heard about it again (sorry ;-)).
You also could google this issue like me while developing. I'm sure there is an answer for this.
Would be nice to leave a note after fixing.
c u Steviex2 16:24, 17 May 2011 (UTC)
Ok, its fixed now. This problem was caused by the entry "de_CH.UTF8" within the indexing settings of Zend Framework. It must read "de_DE.UTF8" to work properly with special characters like ä, ö, ü, etc. So, finally no problems with the extension, thank you! Agoerlt 11:59, 18 May 2011 (UTC)

Search in Microsoft Office documents ( doc, docx, xls, xlsx etc. ) and pdf.

When can we have the possibility to search inside document ( all office format and pdf ) ? Any idea of the release date ? Additionnal question : when we upload a new document or make a new article, does the index is automatically up to date or do we need to launch a complete indexation with a job ? 84.37.20.42 09:54, 8 March 2011 (UTC)

There is currently no timeline to implement new features mentioned as todo's on the extension main page, as long I don't receive urgent, further comercial development assignments. I will do this for sure, but please consider every single kind of file-extension needs a serious programming job in search engine land.
Reindexing is needed by every search engine. You can do this incremental or full. The implementation of this could vary.
As mentioned a common way to do this is triggering the indexer script by a cronjob. But theoretically this could be happen after every editing action (may be a little bit crazy).
UPDATE:
All this features are realized with the next upcoming release (see main page announcements). Steviex2 14:38, 8 March 2011 (UTC)

How to install it on a localhost of windows

I am a newer for Mediawiki. I use the Mediawiki on my comuputer (windows operation system, PHP is in the directory C:\xampp\, Wiki is in the directory D:\www\htdocs\, SQL is in the directory D\www\mysql\). It's very good, and I want to find a search engine. I think this extension is very good. During the process of installation, I have some questions as following:

1 In the frist step, I have downloaded the Zend framwork. I put the contents in \htdocs\psl-suche\. Is it right? is there some paths to be added or changed?

2 In the second step, I move the file PslZendSearchLuceneIndexer.php to \htdocs\psl-suche\. How can I "Edit the marked parts of this file as descriped in it." ?

Thanks a lot! Simonlsw 13:43, 16 March 2011 (UTC)

Hi Simonlsw,
1. You can put the ZendFramework every where you want as long you point to it in LocalSettings.php and the directory is accessable by PHP. For first success "\htdocs\psl-suche\" is a good idea, but keep in mind you can have it also above web root or another dirname then "psl-suche".
2. Open the file "PslZendSearchLuceneIndexer.php" in your prefered IDE or simply text editor and follow the instruction.
Remember to trigger this file to produce a searchable Lucene Index. Steviex2 18:03, 16 March 2011 (UTC)

Question about pslpopularsearches

Hi all, I received the following erro message "1146: Table 'wikidb.mw_mw_pslpopularsearches' doesn't exist"

Anyone have an idea?

(this comment was originally posted by 200.255.122.251 as an addition to the header) Steviex2 18:40, 10 May 2011 (UTC)

Seems, you have a problem with the db-table prefix.
Could you please post the complete error message and the version of ZSL you are using? Steviex2 18:42, 10 May 2011 (UTC)
Hello, think there is a prefix-problem in my wiki too (ZSL 2.0):
Es ist ein Datenbankfehler aufgetreten. Der Grund kann ein Programmierfehler sein.
Die letzte Datenbankabfrage lautete:
INSERT IGNORE INTO `wikiwikipslpopularsearches` (searchcon,results,success,triggertime,
user,ip,rawquery,score,namespace,pids,page,category,rating,pageurl,pagpage,sk)
VALUES ('body_and_title','55','1','2011-05-16 14:13:44',,,'Buch','4.41565438044',,',
840,864,1014,1541,319,1474,842,905,1156,1211,897,715,1548,366,811,421,349,305,1072,426,
480,307,896,846,514,634,306,1551,311,1221,1349,1443,415,371,927,407,327,1248,1402,340,
1530,889,890,360,554,309,145,1470,775,432,1391,1465,304,985,1469',,,,,,
'465e8da6fb92d8a7b7bb24687b89517b')
aus der Funktion „PslZendSearchLuceneDbActions“. Die Datenbank meldete den Fehler „1146:
Table 'wiki.wikiwikipslpopularsearches' doesn't exist (localhost)“.
Thank you. Agoerlt 08:19, 18 May 2011 (UTC)
Same here - what's the fix? Pjtait (talk) 01:19, 20 April 2012 (UTC)
Hi,
as mentioned...
check the db-prefix setup in your LocalSettings.php. Steviex2 (talk) 02:23, 20 April 2012 (UTC)
db-prefix is ok in LocalSettings.php
no solutions yet ? 2001:770:1A4:0:596:6D9D:EF67:5F59 12:10, 4 March 2013 (UTC)
The fix is the same as last year. Could you post some error output? Steviex2 (talk) 12:52, 4 March 2013 (UTC)

How to configure PslZendSearchLuceneIndexerConfig.php

Hi,

could you explain to me how the paths within PslZendSearchLuceneIndexerConfig.php must be configured to get the whole thing working ? I made following configurations:

$GuiFlag = 0;

   $wikisArray[0]['xmlSource']         = "D:\xampp\htdocs\mediawiki\internal_current.xml";
   $wikisArray[0]['indexName']         = "TESTWiki";
   $wikisArray[0]['maintenanceScript'] = "D:\xampp\htdocs\mediawiki\maintenance\dumpBackup.php";
   $wikisArray[0]['mediaDir']          = "D:\xampp\htdocs\mediawiki\images";// maybe httpdocs/images/ if img_auth.php not in use

I get the following error, when I try to run the Indexer

C:\>D:\xampp\php\php.exe -f D:\xampp\htdocs\ZendFramework\PslZendSearchLuceneIndexer.php PHP Warning: require_once(Zend/Search/Lucene.php): failed to open stream: No such file or directory in D:\xampp\htdocs\ZendFramework\PslZendSearchLuceneIndexer.php on line 140

Warning: require_once(Zend/Search/Lucene.php): failed to open stream: No such file or directory in D:\xampp\htdocs\ZendFramework\PslZendSearchLuceneIndexer.php on line 140 PHP Fatal error: require_once(): Failed opening required 'Zend/Search/Lucene.php' (include_path='d: mpp\htdocs\ZendFramework\library') in D:\xampp\htdocs\ZendFramework\PslZendSearchLuceneIndexer.php on line 140

Fatal error: require_once(): Failed opening required 'Zend/Search/Lucene.php' (include_path='d: mpp\htdocs\ZendFramework\library') in D:\xampp\htdocs\ZendFramework\PslZendSearchLuceneIndexer.php on line 140

C:\>

Where is my mistake ?

Thank you

Philipp 194.172.26.135 09:58, 23 May 2011 (UTC)

Found my mistake:
$webServerUser = "";
$webServerUserGroup = "";
$zendFrameworkLibraryPath = "d:\\xampp\\htdocs\\ZendFramework\\library";
$zendLogPath = "d:\xampp\htdocs\\".$indexDirName."\\";
$applicationPath = "d:\xampp\htdocs";
Wrong path under $zendFrameworkLibraryPath = "d:\\xampp\\htdocs\\ZendFramework\\library"; Had to use double backslash.
Fixed it but I still get error-messages in my commandlinewindow- 194.172.26.135 10:08, 23 May 2011 (UTC)
Found another missing "doublebackslash" in my config -> fixed it -> everything OK
Case closed
So long
Philipp 194.172.26.135 10:20, 23 May 2011 (UTC)
never mind / Keine Ursache :-). Steviex2 13:48, 23 May 2011 (UTC)

$wikisArray xmlSource xml file

In the following configuration of PslZendSearchLuceneIndexerConfig.php, how do you establish or figure out the path to the xmlsource file? do you need to create the xml file yourself? should it be found somewhere? I'm trying to get this installed on windows and I'm not having the best of luck.

$wikisArray[0]['xmlSource'] = "D:\xampp\htdocs\mediawiki\internal_current.xml"; $wikisArray[0]['indexName'] = "TESTWiki";

  $wikisArray[0]['maintenanceScript'] = "D:\xampp\htdocs\mediawiki\maintenance\dumpBackup.php";
  $wikisArray[0]['mediaDir']          = "D:\xampp\htdocs\mediawiki\images";// maybe httpdocs/images/ Daddyd205 20:46, 9 June 2011 (UTC)
Hi there,
on win you should use double slashes...see post from Philipp 80.187.106.195 14:32, 10 June 2011 (UTC)

Invalid argument supplied for foreach() in C:\xampp\htdocs\PslZend SearchLuceneIndexer.php on line 421

What to repair when indexing has this result? Thanks...

PHP Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\PslZend SearchLuceneIndexer.php on line 421

Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\PslZendSearc hLuceneIndexer.php on line 421 PHP Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\PslZend SearchLuceneIndexer.php on line 430

Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\PslZendSearc hLuceneIndexer.php on line 430 Rien Satori 09:27, 21 June 2011 (UTC)

Hi, seems $domArr['mediawiki']['page'] is emty...this could mean you have no XML-Data to parse...your MediaWiki data extraction fails, or your Wiki has no pages. Steviex2 12:22, 21 June 2011 (UTC)
Thank you so much for your reply. But the database dump was successful and internal_current.xml file was successfully created too. All other settings are almost exactly according to guide how to install it.
As I understand indexer is independent on LocalSettings.php, so shouldn't matter if I have some misconfiguration there. Rien Satori 23:32, 21 June 2011 (UTC)
Yes indexer is independent on LocalSettings.php. Steviex2 17:13, 22 June 2011 (UTC)
Thanks for the reply. I have found that my wiki was dumping XML file with not allowed character at the beginning, after trimming it, indexing was OK.
I have multilingual smw wiki in English and Japanese in single database and on search results in Japanese I get error in Search results:
Warning: preg_replace() [function.preg-replace]: Compilation failed: unrecognized character after (? or (?- at offset 2 in /my/path/extensions/PslZendSearchLucene/PslZendSearchLucene_body.php on line 1525
anyway the Zend Extansion finds correct page but :
  • "Text" is not displayed under the search results for Japanese
  • foreign UTF8 characters (like other languages in English text) are displayed as ?
  • words inside Japanese sentence are not indexed (as there are no spaces between words in Japanese)
$wgPslUtf8DecodeResults just turns Japanese page names to ????
ad Mediawiki MW Search:
  • same result as mentioned upper
  • foreign UTF8 characters are displayed correct in normal MW Search...
  • words inside Japanese sentence are not indexed (default MW Search probably cannot deal with this)
I don't know what of the mentioned is my misconfiguration and what real troubles, just wanted to share overall result from testing by normal Mediawiki user (not a PHP expert). Rien Satori 06:24, 24 June 2011 (UTC)
Hi Satori,
I will try to reply accordingly from developers point of view- for you and following visitors.
As I know Semantic MediaWiki (smw) is a complete "other peace of Software", or drastically modified MediaWiki.
We never tested ZSL for MediaWiki against this branch.
There is another comment describing problems with Japanese language...so we might can say ZSL is currently not ready
for Japan ;-). But we recognized many downloads from other countries all over the world (without any bug postings) and use it with UTF8 in german language. So we could say it's a stable ZSL release accordingly to the requirements and test scenarios mentioned at the main page. Steviex2 16:28, 24 June 2011 (UTC)
Yes, we have tried this extension in a Japanese environment an failed to used it. You have to consider that when running Apache and Mysql on a real Japanese OS based Windows or Linux environment that this might as well influence in how XML data (especially when you save data on that system) are handled (processed). Assuming that just because it is an UTF-8 enabled extensions does not automatically stand the real test in dealing with Chinese, Korea or Japanese characters, as in in our case we are using SphinxSearch which deals with all sorts of characters.
Just to clarify on the topic Semantic MediaWiki so people that get the wrong impression, it is not a modified MediaWiki, it is an extension (similar to this extensions) that uses standard hooks and parser functions to communicate with the data available from MediaWiki, their are no modifications that influence the standard functionality of MediaWiki nor does it in any away interfere with the database structure. MWJames 18:27, 24 June 2011 (UTC)
Thanks for quick responses :-). I just really wanted to try this search extension because it is amazing implementation which can work on hosting without Java or C++ support. Even if I failed for this moment for my specific purposes (and will need to wait for perfect search engine when I get better hosting), for many users this can be good solution, so I appreciate your effort. Rien Satori 15:58, 25 June 2011 (UTC)

PslZendSearchLuceneIndexerConfig.php problem

The PslZendSearchLuceneIndexerConfig.php file comes with "<?" at the start of the file, should probably be "<?php" as not all of us have short_open_tag enabled. 204.137.29.243 20:34, 14 July 2011 (UTC)

Undefined Method User::getOptions()

When I try to open "Special Pages" I get an error:

Fatal error: Call to undefined method User::getOptions() in /users/lenjo/www/mediawiki-1.15.1/extensions/PslZendSearchLucene/PslZendSearchLucene_body.php on line 116

Where is the method defined? How can I fix that?

Edit: I found the class where getOptions is defined. But that does not solve the problem... 213.70.5.57 09:31, 29 August 2011 (UTC)

You may have the wrong MW-version. Steviex2 02:48, 30 August 2011 (UTC)
Hmm, does that not work with 1.15.1? I do not have the posibility to upgrade, since the MW is not mine... 213.70.5.57 06:41, 30 August 2011 (UTC)
It was never tested against 1.15 and is declared as 1.16-Extension. I will test it against 1.17 soon. Steviex2 07:34, 30 August 2011 (UTC)
oh shoot, I didn't see that. Well, then I have a problem... :-S 213.70.5.57 08:33, 30 August 2011 (UTC)

Suggestions not working

Hello,

Suggestions are not working. Do you have any idea? In LocalSettings.php it is enabled. 212.185.65.91 07:56, 31 August 2011 (UTC)

It should be an issue of your environment. Usually it works fine. Steviex2 08:06, 31 August 2011 (UTC)
Do you have any idea what could be missing? Will i need a special php libary or something like that? 212.185.65.91 09:12, 31 August 2011 (UTC)
Do you know that suggestions could have been configured by users? At first you should play with this settings and test every mode.
As I konw there are no additional PHP-modules necessary. Could you please tell me something about your MW-Version? Steviex2 17:36, 31 August 2011 (UTC)
Ah i didn't configure it for my user...sorry. Then my Problem is 'fixed'.
Thx for your help. 212.185.65.91 06:16, 1 September 2011 (UTC)
Hi, could you please clarify this for me? By "suggestions" you mean that drop-down list that appears bellow the search box as we type, or is it a list of suggestions presented after we click on the search button (something like a "Did you mean?"). Thanks Capmo (talk) 03:08, 24 March 2012 (UTC)
Would guess it's the first one. Steviex2 (talk) 03:12, 24 March 2012 (UTC)

Enhanced, more admin friendly Instructions (mediawiki 1.17.0)

On one hand, i finally got Zend Lucene to work, and on mediawiki 1.17.0, but not without having virtually any documentation that could help.

MediaWiki 1.17.0

PHP 5.3.6 (apache2handler)

MySQL 5.2.8-MariaDB-log


Step 1 - Install / Download Zend Framework Download Zend Framework. Unpack and copy the contents of the download file to a webserver folder (commonly not below web root). Zend Framework install is done! You're NOT exactly done. Here, I had to create a directory called 'zend', above web root (i.e. /var/www/zend) where i extracted the contents of the tar ball.

Step 2 - Configure Zend Search Lucene for MediaWiki Download and extract the extensions PslZslAdmin and PslZendSearchLucene to your Wiki(s) extension directory. Move the files PslZendSearchLuceneIndexer.php and PslZendSearchLuceneIndexerConfig.php to a server directory above web root. Edit the marked parts of the file PslZendSearchLuceneIndexerConfig.php as described in it.

This is where it gets tricky. The config file (PslZendSearchLuceneIndexerConfig.php) unfortunately lacks the proper comments to help any admin intuitively configure Zend in any reasonable ammount of time. Here are some suggestions i would recommend to any admin out there wanting to install Lucene:

1.) In my case, i didn't have an xml repository for my db dumps. So I created a 'source' folder where the xml dumps will be housed. I just created a 'sources' directory in <full path of Zend installation>/sources

2.) Here's how i would've labeled the parameters in the config file:


Instead of:

$wikisArray[0]['xmlSource']         = "/var/www/vhosts/indi.sexyserver4you.de/subdomains/internal/internal_current.xml";

I would've put:

$wikisArray[0]['xmlSource']         = "<full path of xml dumps>/internal_current.xml";

In my case, again, i created a directory specifically designated for these dumps, which was /var/www/zend/sources


Instead of:

$wikisArray[0]['maintenanceScript'] = "/var/www/vhosts/indi.sexyserver4you.de/subdomains/internal/httpdocs/wiki/maintenance/dumpBackup.php";
$wikisArray[0]['mediaDir']          = "/var/www/vhosts/indi.sexyserver4you.de/subdomains/internal/public/";// maybe httpdocs/images/ if img_auth.php not in use


I would've put:

$wikisArray[0]['maintenanceScript'] = "<full path of mediawiki installation>/maintenance/dumpBackup.php";
$wikisArray[0]['mediaDir']          = "<full path of mediawiki installation>/images/";

In my case, <full path of mediawiki installation> = /var/www/html/wiki/mediawiki-1.17.0/


Instead of:

$wikisArray[1]['xmlSource']         = "/var/www/vhosts/indi.sexyserver4you.de/subdomains/sysdoc/sysdoc_current.xml";

I would've put:

$wikisArray[1]['xmlSource']         = "<full path of xml dumps>/sysdoc_current.xml";

In my case, again, i created a directory specifically designated for these dumps, which was /var/www/zend/sources


Instead of

$wikisArray[1]['maintenanceScript'] = "/var/www/vhosts/indi.sexyserver4you.de/subdomains/sysdoc/httpdocs/maintenance/dumpBackup.php";
$wikisArray[1]['mediaDir']          = "/var/www/vhosts/indi.sexyserver4you.de/subdomains/sysdoc/public/";// maybe httpdocs/images/ if img_auth.php not in use


I would've put:

$wikisArray[1]['maintenanceScript'] = "<full path of mediawiki installation>/maintenance/dumpBackup.php";
$wikisArray[1]['mediaDir']          = "<full path of mediawiki installation>/images/";


Instead of:

$PhpExecutionStringUnix         = "/usr/bin/php -c /etc/php5/cli/php.ini";

I would've put:

$PhpExecutionStringUnix         = "/usr/bin/php -c /<location of php.ini file>/php.ini";

In my case <location of php.ini file> = /etc/


Instead of:

$webServerUser              = "www-data";
$webServerUserGroup         = "psaserv";
$zendFrameworkLibraryPath   = "/PSL_ADD_ONS/ZF/library";
$zendLogPath                = "/PSL_ADD_ONS/".$indexDirName."/";
$applicationPath            = "/PSL_ADD_ONS";


I would've put:

$webServerUser              = "<your web server user>";
$webServerUserGroup         = "<your web server group>";
$zendFrameworkLibraryPath   = "/<installation path of Zend>/ZendFramework-1.11.10/library";
$zendLogPath                = "/<installation path of Zend>/".$indexDirName."/";
$applicationPath            = "/<installation path of Zend>/";


3.) Here's how i would've labeled the config parameters for LocalSettings.php

/* Configuration Zend Search Lucene for MediaWiki - Start */
$PslDomainDir                   = "sysdoc";
$PslPhpExecutionStringUnix      = "/usr/bin/php -c /<full path to php.ini file>/php.ini ";
$PslMaintenancePath             = "/<full path to mediawiki installation>/maintenance/";
$PslXmlPath                     = "/<full path to xml dumps or sources>/".$PslDomainDir."_current.xml";

$wgPslZslAdminUseAutoReIndex    = false;
$wgPslZslAdminDefaultEmail      = "<your email address>";
$wgPslZslAdminDumpString        = $PslPhpExecutionStringUnix.$PslMaintenancePath."dumpBackup.php --current --quiet --uploads > ".$PslXmlPath;
$wgPslZslAdminMediaDir          = "<full path of mediawiki installation ir directory where you store uploaded docs>/images/";
$wgPslZslAdminReIndexString     = $PslPhpExecutionStringUnix."/<full path to Zend Installation>/PslZendSearchLuceneIndexer.php ".$PslXmlPath." wikidb_".$PslDomainDir." ".  $PslMaintenancePath."dumpBackup.php"; 

require_once( "$IP/extensions/PslZslAdmin/PslZslAdmin.php");

$wgSearchType                      = 'PslZendSearchLucene';
$wgPslEnableSuggestions            = true;//enables suggestions
$wgPslEnableStopWords              = false;//enables stop words
$wgPslStopWords                    = array('aber','als','am','an');
$wgPslImagePath                    = "http://<wiki domain or ip address of wiki server>/extensions/PslZendSearchLucene/";

$wgPslWikiUrl                      = "http://<wiki url>/mediawiki-1.17.0/index.php/";
$wgPslEntriesPerPage               = 20;
$wgPslUtf8DecodeResults            = false;//utf8-hint for related display issues, (play around with this if needed)
$wgPslIndexDir                     = "/<full path to Zend Installation>/psl_search_indexes/wikidb_".$PslDomainDir;
$wgPslZendLibraryDir               = "/<full path to Zend Installation>/ZendFramework-1.11.10/library/";
$wgPslEnablePopularSearches        = true;//requires table-create rights for MediaWikis db-account
$wgPslPopularSearchesHistory       = 365;//data remains 365 days
$wgPslProtectPopularSearches       = false;//
$wgPslHighlightColor               = "#ff6900";
$wgPslEnabaleDebugMode             = false;//debug mode
$wgPslEnableSuggestions            = true;//enables suggestions
$wgPslEnableFileSearch             = true;//enables file search
$wgPslEnablePsIpTracking           = false;//enables ip tracking for geo lacation services etc. (currently not implemented)
$wgPslEnableAnonKey                = true;//anonymous key for science
$wgPslHistoryEntries               = 30;//history entries per page
$wgPslHistoryMiniStat              = true;

$wgHiddenPrefs[] = 'searchlimit';//this entries are disabling no more needed user preferences of the old/default search
$wgHiddenPrefs[] = 'contextlines';
$wgHiddenPrefs[] = 'contextchars';
$wgHiddenPrefs[] = 'disablesuggest';
$wgHiddenPrefs[] = 'searcheverything';
$wgHiddenPrefs[] = 'searchnamespaces';
$wgPslEnableUserInHistory          = false;//enhanced knowledge management feature could tackle your country specific law!
require_once( "$IP/extensions/PslZendSearchLucene/PslZendSearchLucene.php");
/* Configuration Zend Search Lucene for MediaWiki - End */


4.) Finally, make sure you check your permissions! Your xml dump/source directory must be owned by the web server user and in the web server group. In my case, apache:apache. A simply chown -R apache:apache . in the Zend installation directory should do the trick.

Hope this helps! Ucananduwill 19:12, 22 September 2011 (UTC)

Thank you for your contributions. Nice to heare it's running on 1.17. We have several hundred downloads and less then 20 questions about setup till now. So this wasn't on my toDo-list :-). Steviex2 20:31, 22 September 2011 (UTC)
Thank you for taking the time for these instructions, they really helped me! It's an awesome extension but so confusing to set up at first glance. Now it breaks my template, but that's a minor thing to fix! :) 21:23, 4 October 2011 (UTC)
1+ 92.200.30.113 14:02, 12 October 2012 (UTC)
The above very good for admins installing using *nix, I've been struggling under Windows to get this sorted, is there a Windows version of the above? 203.48.50.180 03:11, 20 December 2012 (UTC)
The orig. documentation in the package should have win-examples too. 86.56.60.136 13:07, 20 December 2012 (UTC)
the Zend link is broken, which zend version to use ? 62.212.97.179 06:48, 8 August 2013 (UTC)
1.12 86.56.60.8 19:54, 8 August 2013 (UTC)

Blank page when searching

SOLVED: Problem was that the directorys were owned by the user apache instead of nobody, which was actually the webserver-user.

Hello everyone,

I´ve installed ZF and the Zendsearchlucene for Mediawiki extension.

The index-process runs smoothly and without an error.

Problem is, that I get a blank page as soon as I hit the search button. No error-message and no hint what´s wrong.

Here´s my config:

Webroot is /opt/lampp/htdocs (+/mediawiki as symlink to mw installation path /opt/lampp/htdocs/mediawiki_1.17.0)

ZendF resides in /opt/lampp/zend/

The relevant parts of the config are:

Index Config

$GuiFlag = 0;


$wikisArray[0]['xmlSource'] = "/opt/lampp/zend/sources/internal_current.xml";
$wikisArray[0]['indexName'] = "wikidb_internal";
$wikisArray[0]['maintenanceScript'] = "/opt/lampp/htdocs/mediawiki/maintenance/dumpBackup.php";
$wikisArray[0]['mediaDir'] = "/opt/lampp/htdocs/mediawiki/images";// maybe httpdocs/images/ if img_auth.php not in use



#$wikisArray[1]['xmlSource'] = "/opt/lampp/zend/sources/sysdoc_current.xml";
#$wikisArray[1]['indexName'] = "wikidb_sysdoc";
#$wikisArray[1]['maintenanceScript'] = "/opt/lampp/htdocs/mediawiki/maintenance/dumpBackup.php";
#$wikisArray[1]['mediaDir'] = "/opt/lampp/htdocs/mediawiki/images/";// maybe httpdocs/images/ if img_auth.php not in use

#[...]

endif;



@preg_match_all("/(Windows)(.*?)/", $_SERVER['OS'], $matched, PREG_SET_ORDER);




/* an index dir above web root */




	$indexDirName = "psl_search_indexes";
	$PhpExecutionStringUnix = "/opt/lampp/bin/php -c /opt/lampp/etc/php.ini";
	$PhpExecutionStringWindows = "c:\\xampp\\php\\php.exe ";


	$email = [mailto:info@my.reporting-mailadress.ork info@my.reporting-mailadress.ork];




/* file formats which will be indexed */
$additionalFileFormatsArray = array('pdf','docx','xlsx','pptx','sql','vnd','txt','xml','xmlx','csv');

if(count($matched) > 0 ):
/* modify this to fit your needs, if you are on windows */




	$webServerUser = "";
	$webServerUserGroup = "";
	$zendFrameworkLibraryPath = "C:\\xampp\\htdocs/ZF/library";
	$zendLogPath = "C:\\xampp\\htdocs\\".$indexDirName."\\";
	$applicationPath = "C:\\xampp\\htdocs";




else:




/* modify this to fit your needs, if you are on unix */




	$webServerUser = "apache";
	$webServerUserGroup = "apache";
	$zendFrameworkLibraryPath = "/opt/lampp/zend/library";
	$zendLogPath = "/opt/lampp/zend/".$indexDirName."/";
	$applicationPath = "/opt/lampp/zend/";
endif;

Local-settings from Mediawiki

/* Configuration Zend Search Lucene for MediaWiki - Start */
$PslDomainDir = "internal";
$PslPhpExecutionStringUnix = "/opt/lampp/bin/php -c /opt/lampp/etc/php.ini ";
$PslMaintenancePath = "/opt/lampp/htdocs/mediawiki/maintenance/";
$PslXmlPath = "/opt/lampp/zend/sources/".$PslDomainDir."_current.xml";


$wgPslZslAdminUseAutoReIndex = false;
$wgPslZslAdminDefaultEmail = "<your email address>";
$wgPslZslAdminDumpString = $PslPhpExecutionStringUnix.$PslMaintenancePath."dumpBackup.php --current --quiet --uploads > ".$PslXmlPath;
$wgPslZslAdminMediaDir = "/opt/lampp/htdocs/mediawiki/images/";
$wgPslZslAdminReIndexString = $PslPhpExecutionStringUnix."/opt/lampp/zend/PslZendSearchLuceneIndexer.php ".$PslXmlPath." wikidb_".$PslDomainDir." ". $PslMaintenancePath."dumpBackup.php";



require_once( "$IP/extensions/PslZslAdmin/PslZslAdmin.php");



$wgSearchType = 'PslZendSearchLucene';
$wgPslEnableSuggestions = true;//enables suggestions
$wgPslEnableStopWords = false;//enables stop words
$wgPslStopWords = array('aber','als','am','an');
$wgPslImagePath = [http://172.23.101.63/mediawiki/extensions/PslZendSearchLucene/ http://172.23.101.63/mediawiki/extensions/PslZendSearchLucene/];



$wgPslWikiUrl = "http://172.23.101.63/mediawiki-1.17.0/index.php/";
$wgPslEntriesPerPage = 20;
$wgPslUtf8DecodeResults = false;//utf8-hint for related display issues, (play around with this if needed)
$wgPslIndexDir = "/opt/lampp/zend/psl_search_indexes/wikidb_".$PslDomainDir;
$wgPslZendLibraryDir = "/opt/lampp/zend/library/";
$wgPslEnablePopularSearches = true;//requires table-create rights for MediaWikis db-account
$wgPslPopularSearchesHistory = 365;//data remains 365 days
$wgPslProtectPopularSearches = false;//
$wgPslHighlightColor = "#ff6900";
$wgPslEnabaleDebugMode = false;//debug mode
$wgPslEnableSuggestions = true;//enables suggestions
$wgPslEnableFileSearch = true;//enables file search
$wgPslEnablePsIpTracking = false;//enables ip tracking for geo lacation services etc. (currently not implemented)
$wgPslEnableAnonKey = true;//anonymous key for science
$wgPslHistoryEntries = 30;//history entries per page
$wgPslHistoryMiniStat = true;



$wgHiddenPrefs[] = 'searchlimit';//this entries are disabling no more needed user preferences of the old/default search
$wgHiddenPrefs[] = 'contextlines';
$wgHiddenPrefs[] = 'contextchars';
$wgHiddenPrefs[] = 'disablesuggest';
$wgHiddenPrefs[] = 'searcheverything';
$wgHiddenPrefs[] = 'searchnamespaces';
$wgPslEnableUserInHistory = false;//enhanced knowledge management feature could tackle your country specific law!
require_once( "$IP/extensions/PslZendSearchLucene/PslZendSearchLucene.php");
/* Configuration Zend Search Lucene for MediaWiki - End */

Anyone an idea? I already tried several combinations of paths but none would work.

Greetings, and thanks in advance...

F 141.84.149.10 08:03, 20 October 2011 (UTC)

EDIT: Sorry, i think your problem is different, miss read your problem, mine is no search result but i think
yours is no access to folder .
Dear,
How did you fix your problem? I think i got the same problem as you
There's no search result even if i search for a test topic inside my mediawiki
I've already set webuser and webusergroup to apache, which is the directory owner of my wiki at the moment
or is the webuser.. my database admin id?
Thanks in advance.
Regards,
Nick Nick1092 (talk) 02:20, 29 April 2013 (UTC)

XmlDump won't work on Windows

Hello,

I installed the extension yesterday and tried to have it working but I always get the same error message when running the indexer:

2011-11-09T18:29:52+01:00 INFO (6): LuceneIndexer Error-Message! ERROR dumpXML() 
"C:\Program Files\EasyPHP 3.0\php\php.exe" -c "C:\Program Files\EasyPHP 3.0\conf_files\php.ini" 
D:/Wikis/mediawiki-1.17.0/maintenance/dumpBackup.php --current --quiet --uploads 
> D:/Wikis/search-engine/psl_sources/af_current.xml---Status -> 1

However, when I copy/paste and run myself the command above in the same cmd.exe where I ran the indexer (so in the same conditions normally), this works fine and my af_current.xml is correctly filled with the dump.

Any idea?

(I'm on mediaWiki 1.17 but this has no link with the above mentioned stuff, I think) 193.56.136.200 07:14, 10 November 2011 (UTC)

Hi,
strange, never heard about it before.
dumpXML should be a funktion in the code. What you could do is, to go there...see what the funktion is trying to do and print out anny information available at this point (pathes etc.). Also be sure that your WAMP System has the needed rights for this task. Steviex2 12:58, 10 November 2011 (UTC)

Search multiple wikis

In the documentation you list unlimited wiki instances as a feature, can I run a search across all index and return results for all the wikis? Ashex 05:33, 10 February 2012 (UTC)

This could have been done by modifying the source code. "Unlimited instances" is first related to the indexer, meaning you have a server with several MediaWiki-installations and whish to index all with a single nightly cron job. 80.187.107.3 01:00, 11 February 2012 (UTC)
Could you possibly elaborate on that? I have a Wiki family (single server running multiple wikis, each has a separate database) and would like to be able to search across them. Ashex (talk) 21:50, 24 February 2012 (UTC)
This is no standard feature of ZSL and would require approximately several days of investigations and development. Unfortunately I can't provide this on a non profit base. This could also be a preformance related issue and may fail. We currently have no experience on doing so. If all this doesn't matter you could require a quote on www.wiki-service.biz. You could also check an alternative enterprise search engine like Solr.
c u stevie Steviex2 (talk) 22:16, 24 February 2012 (UTC)
If it's not a standard feature and would require additional development of the extension, then why is it listed as a feature? Ashex (talk) 01:36, 26 February 2012 (UTC)
Unlimited instances is related to the indexer! Steviex2 (talk) 17:15, 26 February 2012 (UTC)

I am maintaining a wiki on a local intranet. Could you tell me if Zend search will show the link to the wiki page which contains an indexed document or if it only links to the indexed document.

Our current search will find a phrase in 'aaa.pdf' but when you click the link, you can only open 'aaa.pdf', you cannot see where 'aaa.pdf' is linked on the wiki.

Thanks. 203.5.217.3 04:18, 26 April 2012 (UTC)

It should list the file link and pages containing "aaa.pdf". Further more it should allow to find phrases inside a pdf-document as long as you extended the code a little bit.
c u stevie Steviex2 (talk) 15:50, 30 April 2012 (UTC)
Can you elaborate or provide links to further information on how to extend the code to search inside pdf documents? This is the main reason I would like to use Zend Search Lucene for MediaWiki.
Thanks Rpsteiner (talk) 22:09, 24 May 2012 (UTC)
Hi Rpsteiner,
Open file PslZendSearchLuceneIndexer.php, go to line 530 "...We will do this...". This should be the location to index pdf-content.
Unfortunately there was no further sponsor to let this happen, but you could do it by yourself If you are coder. The keyword here is XPDF (name of an external linux library). This task should be easy- but would need some hours. Whish you good luck...may you can contribute the necessary code portion here. I would integrate it in a next release (providing an exception for windows users etc.).
c u stevie Steviex2 (talk) 22:35, 24 May 2012 (UTC)

It works in MediaWiki 1.20.2

It works in MediaWiki 1.20.2, but I get an error message when I run PslZendSearchLuceneIndexer.php on bash:

Warning: chgrp(): Unable to find gid for somewiki in /home/content/30/9164430/html/zend/PslZendSearchLuceneIndexer.php on line 296
2012-12-18T16:14:47-07:00 INFO (6): LuceneIndexer Error-Message! ERROR: chgrp command: :/home/content/30/9164430/html/zend/psl_search_indexes/wikidb_sysdoc:somewiki-->wikidb_sysdoc

What is it mean? How can I fix this? | Jaider Msg 00:20, 19 December 2012 (UTC)

Hi,
If "wikidb_sysdoc" is'nt one of your wiki db's, you are playing with some dummy data. Refere to your configuration and replace it with your real world data. 86.56.60.136 09:32, 19 December 2012 (UTC)
Thanks | Jaider Msg 13:25, 19 December 2012 (UTC)

require_once(Zend/Search/Lucene.php): failed to open stream

Warning: require_once(Zend/Search/Lucene.php): failed to open stream: No such file or directory in D:\Wwwroot\PslZendSearchLuceneIndexer.php on line 140

The documentation provides example of how to get around this error on Apache. Can we get an example for IIS? MadX (talk) 07:57, 7 February 2013 (UTC)

This is a very low level PHP-include-error which should be handled on both systems nearly the same way. You could check the incldue_path-settings of PHP. Steviex2 (talk) 08:28, 7 February 2013 (UTC)

Indexer error when reading internal_current.xml

Hi, the indexer is logging an error when attempting to read the contents of internal_current.xml. This results in zero documents indexed. I'm running MW 1.19.2/PHP 5.2.8/MySQL 5.1.37/W2K3. How can I resolve this?

D:\>PHP\php.exe -f d:\Wwwroot\zend\PslZendSearchLuceneIndexer.php
2013-03-27T11:14:52-07:00 INFO (6): Indexer initializing ...
2013-03-27T11:14:52-07:00 INFO (6): Start madxwikidb-1_19_2 at: 27.03.2013 11:14:52
2013-03-27T11:14:52-07:00 INFO (6): incrementUpdate: 0
2013-03-27T11:14:58-07:00 INFO (6): LuceneIndexer Status-Message! SUCCESS dumpXML() D:\PHP\php.exe D:\Wwwroot\madxwiki-
1.19.2\maintenance\dumpBackup.php --current --quiet --uploads > D:\Wwwroot\zend\sources\internal_current.xml----Status -> 255-->madxwikidb-1_19_2
2013-03-27T11:14:59-07:00 INFO (6): LuceneIndexer Status-Message! SUCCESS: chmod command: 1:D:\Wwwroot\zend\sources
\internal_current.xml-->madxwikidb-1_19_2
2013-03-27T11:14:59-07:00 INFO (6): Created new index in D:\Wwwroot\psl_search_indexes\madxwikidb-1_19_2\data\cache\index
2013-03-27T11:15:01-07:00 INFO (6): LuceneIndexer Error-Message! ERROR XML-Source file_get_contents : D:\Wwwroot\zend\sources
\internal_current.xml-->madxwikidb-1_19_2
2013-03-27T11:15:01-07:00 INFO (6): Optimizing index: madxwikidb-1_19_2
2013-03-27T11:15:01-07:00 INFO (6): Iterator over 0 documents (HTML)
2013-03-27T11:15:01-07:00 INFO (6): Done. Index now contains 0 documents
2013-03-27T11:15:01-07:00 INFO (6): Indexing complete
2013-03-27T11:15:01-07:00 INFO (6): Wiki-Start madxwikidb-1_19_2 at: 27.03.2013 11:14:52
2013-03-27T11:15:01-07:00 INFO (6): Wiki-End madxwikidb-1_19_2 at: 27.03.2013 11:15:01
2013-03-27T11:15:01-07:00 INFO (6): Indexer initializing ...
2013-03-27T11:15:01-07:00 INFO (6): Start madxwikidb-1_19_2 at: 27.03.2013 11:15:01
2013-03-27T11:15:01-07:00 INFO (6): incrementUpdate: 0
2013-03-27T11:15:02-07:00 INFO (6): LuceneIndexer Status-Message! SUCCESS dumpXML() D:\PHP\php.exe D:\Wwwroot\madxwiki-1.19.2\maintenance\dumpBackup.php --current --quiet --uploads > D:\Wwwroot\zend\sources\sysdoc_current.xml----Status -> 255-->madxwikidb-1_19_2
2013-03-27T11:15:03-07:00 INFO (6): LuceneIndexer Status-Message! SUCCESS: chmod command: 1:D:\Wwwroot\zend\sources\sysdoc_current.xml-->madxwikidb-1_19_2
2013-03-27T11:15:03-07:00 INFO (6): Open existing index in D:\Wwwroot\psl_search_indexes\madxwikidb-1_19_2\data\cache\index
2013-03-27T11:15:05-07:00 INFO (6): '''LuceneIndexer Error-Message! ERROR XML-Source file_get_contents : D:\Wwwroot\zend\sources\sysdoc_current.xml-->madxwikidb-1_19_2'''
2013-03-27T11:15:05-07:00 INFO (6): Optimizing index: madxwikidb-1_19_2
2013-03-27T11:15:05-07:00 INFO (6): Iterator over 0 documents (HTML)
2013-03-27T11:15:05-07:00 INFO (6): Done. Index now contains 0 documents
2013-03-27T11:15:05-07:00 INFO (6): Indexing complete
2013-03-27T11:15:05-07:00 INFO (6): Wiki-Start madxwikidb-1_19_2 at: 27.03.2013 11:15:01
2013-03-27T11:15:05-07:00 INFO (6): Wiki-End madxwikidb-1_19_2 at: 27.03.2013 11:15:05

MadX (talk) 21:01, 27 March 2013 (UTC)

You are dealing with dummy data. The name of the XML files should reflect real world dirnames.
You also need only one XML-source per Wiki. Steviex2 (talk) 22:38, 15 April 2013 (UTC)

Fatal Error calling mb_strtolower()

Dear,

I got this fatal error
Fatal error: Call to undefined function mb_strtolower() in /var/www/mediawiki1.20.4/extensions/PslZendSearchLucene/PslZendSearchLucene_body.php on line 975.
I check that fine, it's mb_strtolower($wgRequest ->getText('category'));
anyone got this problem before?
Any help is welcome, thanks in advance.

Mediawiki 1.20.4 Nick1092 (talk) 08:21, 26 April 2013 (UTC)

AFAIK, "mb_strtolower()" depends on an extra PHP library....
http://php.net/manual/en/mbstring.installation.php
Alternative you could try to substitute the function with "strtolower()". I m afraid there are some more lines which uses this PHP library, so the savest way is to configure your PHP accordingly.
Keep in mind that this dependency is already mentioned in the requirements (mbstring).
cheers. Steviex2 (talk) 17:37, 26 April 2013 (UTC)
thanks for the help Steviex, i'll try to configure my php for this. My mistake for missing this mbstring enable line under requirements. Nick1092 (talk) 01:19, 29 April 2013 (UTC)

No search result. <Solved>

Dear,

When i try to search for a topic that i've created to test the search function, i get
no search results. I tried changing the installation path and path to my mediawiki
and run /usr/bin/php -c /etc/php.ini /usr/local/search/ZSearch/PslZendSearchLuceneIndexer.php
and end up with this 2 error
PHP Notice: Undefined variable: wikisArray in /usr/local/search/ZSearch/PslZendSearchLuceneIndexer.php on line 34 <br\> PHP Warning: Invalid argument supplied for foreach() in /usr/local/search/ZSearch/PslZendSearchLuceneIndexer.php on line 34
line 34: foreach($wikisArray as $key => $val): which i think is the main cause of this problem.
I tried changing paths in PslZendSearchLuceneIndexerConfig.php but cant seems to solve this problem.
Anyone got any hint for me as to how to fix this
or anyone have similar problem previously that can point me to the right direction?

Thanks in advance.

Regards Nick Nick1092 (talk) 02:44, 29 April 2013 (UTC)

wikisArray is a config var where you define your settings/Wikis. You should fill it up with your individual data. Scroll the file to see where it is set. "ps aux|grep apache" retrieves your current apache user on Linux...but I think this is not the problem.
cheers. Steviex2 (talk) 07:11, 29 April 2013 (UTC)
Dear Steviex,
at the moment i just assume that i filled in the wrong details? Here's what i got at the moment on the config file
/* This part is for you! Configure multiple Wiki-instances if needed, see examples below */
   
    $GuiFlag                            = 0;
    $wikisArray[0]['xmlSource']         = "/var/www/zend/sources/internal__current.xml";
    $wikisArray[0]['indexName']         = "my_wiki";  
    $wikisArray[0]['maintenanceScript'] = "/var/www/mediawiki/maintenance/dumpBackup.php";
    $wikisArray[0]['mediaDir']          = "/var/www/mediawiki/images/";
    #$wikisArray[1]['xmlSource']         = "/var/www/zend/sources/sysdoc_current.xml";
    #$wikisArray[1]['indexName']         = "wikidb_sysdoc";
    #$wikisArray[1]['maintenanceScript'] = "/var/www/mediawiki/maintenance/dumpBackup.php";
    #$wikisArray[1]['mediaDir']          = "/var/www/mediawiki/images/"
; 
    #[...]
endif;
@preg_match_all("/(Windows)(.*?)/", $_SERVER['OS'], $matched, PREG_SET_ORDER);
/* an index dir above web root */
$indexDirName                   = "psl_search_indexes";
$PhpExecutionStringUnix         = "/usr/bin/php -c /etc/php.ini";
$PhpExecutionStringWindows      = "c:\\xampp\\php\\php.exe ";
$email                          = "";
/* file formats which will be indexed */
$additionalFileFormatsArray     = array('pdf','docx','xlsx','pptx','sql','vnd','txt','xml','xmlx','csv');
if(count($matched) > 0 ):
/* modify this to fit your needs, if you are on windows */
    $webServerUser              = "";
     $webServerUserGroup         = "";
    $zendFrameworkLibraryPath   = "C:\\xampp\\htdocs/ZF/library";
    $zendLogPath                = "C:\\xampp\\htdocs\\".$indexDirName."\\";
    $applicationPath            = "C:\\xampp\\htdocs";
else:
/* modify this to fit your needs, if you are on unix */
    $webServerUser              = "apache";
    $webServerUserGroup         = "apache";
    $zendFrameworkLibraryPath   = "/var/www/zend/ZendFramework-1.11.15/library";
    $zendLogPath                = "/var/www/zend/".$indexDirName."/";
    $applicationPath            = "/var/www/zend/";
endif;
?>
I assume the indexname means my database name? Nick1092 (talk) 07:52, 29 April 2013 (UTC)
Edit : Double posted Nick1092 (talk) 07:52, 29 April 2013 (UTC)
Hello,
yes indexName reflects the Lucene index name as well as the db-name. Keep in mind the first array index "0", "1" and so on reflects a dedicated Wiki, so if you actually need it for one Wiki you have to fill only $wikiArray[0].
If you need ZSL for 10 Wikis you would have to fill wikiArray[0] untill wikiArray[9]. Do not use wikiArray[1] with wikidb_sysdoc etc...its only dummy configuration data to show that the engine could be used with multiple Wiki instances.
cheers. Steviex2 (talk) 09:04, 29 April 2013 (UTC)
Dear,
Yeh already commented the second wikiarray out.
I created an empty directory /var/www/zend/sources for the internal_current.xml
entered my db name, the correct dumpbackup.php and images path .
cant find what's wrong with it. Doubt it's directory permission problem.
However, when i do it through PslZslAdmin, a sysdoc_current.xml is created in the sources dir.
Regards Nick1092 (talk) 03:12, 30 April 2013 (UTC)
Hi,
"sysdoc_current" should not have been created because its the second dummy data as you see above. As I remeber you have to configure in LocalSettings.php too for PslZslAdmin.
Since the prefix in the name reflects your wiki its typically the name of a directory or If you want your wgScriptPath.
So sysdoc_current would be named meidawiki_current in your environment. Or my_wiki_current...I m a little bit confused.
Could you provide the full path to your Wiki and the real DB-Name. May be its an option to give me system access to see what happens. You can reach me over the mentioned service pages.
cheers. Steviex2 (talk) 23:42, 1 May 2013 (UTC)
Hello,
My database name is my_wiki
i checked it with mysql directory to make sure there's no typo, yeh it's my_wiki
and my mediawiki path is /var/www/mediawiki
would love to let you see what's going on, maybe it's because of the semantic i installed? cause apparently it's not tested with semantic extensions.
and sorry about this , i'm quite sure i missed it somewhere ,but service pages?
Regards
Nick Nick1092 (talk) 01:36, 2 May 2013 (UTC)
Meanwhile it is positive tested with SMW but retrieves no special semantic data. For this purpose Solr may would be better...or customizing ZSL. Steviex2 (talk) 02:16, 2 May 2013 (UTC)
hey, sorry but for some reason that link lead me.. to somewhere which i think its not suppose to be. Nick1092 (talk) 02:44, 2 May 2013 (UTC)
It was the right link. Alternatively you could provide your mail address here...I dont do this. Steviex2 (talk) 02:59, 2 May 2013 (UTC)
Dear,
i mean that link lead me to some NFS car site lol, i doubt my cpu got any spyware or anything, cause i tested that site on my phone safari, and other device and still pop up the same site. Unless that's really the site and i got confuse.. or that site got redirected for some reason.
I've created a new email address for this hopefully it's ok, cause if i enter my real email, i'll probably get massive bombardment of different stuff.
nicky1092@outlook.com

And sorry for troubling you with all this.
Regards Nick1092 (talk) 03:17, 2 May 2013 (UTC)
Sorry its my custom spam protection...will check it later and send mail. Steviex2 (talk) 03:38, 2 May 2013 (UTC)
no problem, i created a new email to protect my real email from spams as well.
Thanks again. Nick1092 (talk) 03:48, 2 May 2013 (UTC)
I send an email. Steviex2 (talk) 11:56, 2 May 2013 (UTC)
thanks. Nick1092 (talk) 03:15, 3 May 2013 (UTC)
PslZendSearchLuceneIndexerConfig.php
Directory : /usr/local/search/ZSearch
<?
/* This part is for command operations only, usualy you should not touch it */
setlocale(LC_ALL, 'de_CH.UTF8');
header('Content-Type: text/html; charset=utf-8');
$debugMode = 1;
ini_set('max_execution_time',36000000);
if($debugMode==1):
    error_reporting(E_ALL);
    ini_set("display_errors", 1);
else:
    error_reporting (E_ALL ^ E_NOTICE);
    ini_set("display_errors", 0);
endif;
define("LINE_BREAK", "\n\n<br/>");
$argsNum = count($_SERVER['argv']);
if($argsNum>1):
    $wikisArray[0]['xmlSource']         = $_SERVER['argv'][1];
    $wikisArray[0]['indexName']         = $_SERVER['argv'][2];
    $wikisArray[0]['maintenanceScript'] = $_SERVER['argv'][3];
    if(isset($_SERVER['argv'][4])):
        $GuiFlag                        = $_SERVER['argv'][4];
    else:
        $GuiFlag                        = 0;
    endif;
   if(isset($_SERVER['argv'][5])):
       $wikisArray[0]['incrementUpdate']= (int)$_SERVER['argv'][5];
   else:
        $wikisArray[0]['incrementUpdate']= 0;
   endif;
   if(isset($_SERVER['argv'][6])):
        $wikisArray[0]['useFiles']      = $_SERVER['argv'][6];
   else:
        $wikisArray[0]['useFiles']      = "";
   endif;
   if(isset($_SERVER['argv'][7])):
        $wikisArray[0]['mediaDir']      = $_SERVER['argv'][7];
   else:
        $wikisArray[0]['mediaDir']      = "";
   endif;
else:
    /* This part is for you! Configure multiple Wiki-instances if needed, see examples below */
    $GuiFlag                            = 0;
    $wikisArray[0]['xmlSource']         = "/var/www/zend/sources/internal_current.xml";
    $wikisArray[0]['indexName']         = "my_wiki";
    $wikisArray[0]['maintenanceScript'] = "/var/www/mediawiki-1.20.4/maintenance/dumpBackup.php";
    $wikisArray[0]['mediaDir']          = "/var/www/mediawiki-1.20.4/images/";
endif;
@preg_match_all("/(Windows)(.*?)/", $_SERVER['OS'], $matched, PREG_SET_ORDER);
/* an index dir above web root */
$indexDirName                   = "my_wiki";
$PhpExecutionStringUnix         = "/usr/bin/php -c /etc/php.ini";
$PhpExecutionStringWindows      = "c:\\xampp\\php\\php.exe ";
$email                          = "";
/* file formats which will be indexed */
$additionalFileFormatsArray     = array('pdf','docx','xlsx','pptx','sql','vnd','txt','xml','xmlx','csv');
if(count($matched) > 0 ):
/* modify this to fit your needs, if you are on windows */
    $webServerUser              = "";
    $webServerUserGroup         = "";
    $zendFrameworkLibraryPath   = "C:\\xampp\\htdocs/ZF/library";
    $zendLogPath                = "C:\\xampp\\htdocs\\".$indexDirName."\\";
    $applicationPath            = "C:\\xampp\\htdocs";
else:
/* modify this to fit your needs, if you are on unix */
    $webServerUser              = "apache";
    $webServerUserGroup         = "apache";
    $zendFrameworkLibraryPath   = "/var/www/zend/ZendFramework-1.11.15/library";
    $zendLogPath                = "/var/www/zend/".$indexDirName."/";
    $applicationPath            = "/var/www/zend/";
endif;
?>
113.210.3.154 06:43, 3 May 2013 (UTC)
LocalConfig file of mediawiki
Dir: /var/www/mediawiki
Zend lib and sources dir: /var/www/zend
Database name: my_wiki
# Zend Search Lucene Search Engine
$PslDomainDir                   = "sysdoc";
$PslPhpExecutionStringUnix      = "/usr/bin/php -c /etc/php.ini ";
$PslMaintenancePath             = "/var/www/mediawiki/maintenance/";
$PslXmlPath                     = "/var/www/zend/sources/".$PslDomainDir."_current.xml";
$wgPslZslAdminUseAutoReIndex    = false;
$wgPslZslAdminDefaultEmail      = "";
$wgPslZslAdminDumpString        = $PslPhpExecutionStringUnix.$PslMaintenancePath."dumpBackup.php --current --quiet --uploads > ".$PslXmlPath;
$wgPslZslAdminMediaDir          = "/var/www/mediawiki/images/";
$wgPslZslAdminReIndexString     = $PslPhpExecutionStringUnix."/usr/local/search/ZSearch/PslZendSearchLuceneIndexer.php ".$PslXmlPath." wikidb_".$PslDomainDir." ".  $PslMaintenancePath."dumpBackup.php";
require_once( "$IP/extensions/PslZslAdmin/PslZslAdmin.php");
$wgSearchType                      = 'PslZendSearchLucene';
$wgPslEnableSuggestions            = true;//enables suggestions
$wgPslEnableStopWords              = false;//enables stop words
$wgPslStopWords                    = array('aber','als','am','an');
$wgPslImagePath                    = "http://host/mediawiki/extensions/PslZendSearchLucene/";
$wgPslWikiUrl                      = "http://host/mediawiki/index.php/";
$wgPslEntriesPerPage               = 20;
$wgPslUtf8DecodeResults            = false;//utf8-hint for related display issues, (play around with this if needed)
$wgPslIndexDir                     = "/var/www/zend/psl_search_indexes/wikidb_".$PslDomainDir;
$wgPslZendLibraryDir               = "/var/www/zend/ZendFramework-1.11.15/library/";
$wgPslEnablePopularSearches        = true;//requires table-create rights for MediaWikis db-account
$wgPslPopularSearchesHistory       = 365;//data remains 365 days
$wgPslProtectPopularSearches       = false;//
$wgPslHighlightColor               = "#ff6900";
$wgPslEnabaleDebugMode             = false;//debug mode
$wgPslEnableSuggestions            = true;//enables suggestions
$wgPslEnableFileSearch             = true;//enables file search
$wgPslEnablePsIpTracking           = false;//enables ip tracking for geo lacation services etc. (currently not implemented)
$wgPslEnableAnonKey                = true;//anonymous key for science
$wgPslHistoryEntries               = 30;//history entries per page
$wgPslHistoryMiniStat              = true;
$wgHiddenPrefs[] = 'searchlimit';//this entries are disabling no more needed user preferences of the old/default search
$wgHiddenPrefs[] = 'contextlines';
$wgHiddenPrefs[] = 'contextchars';
$wgHiddenPrefs[] = 'disablesuggest';
$wgHiddenPrefs[] = 'searcheverything';
$wgHiddenPrefs[] = 'searchnamespaces';
$wgPslEnableUserInHistory          = false;//enhanced knowledge management feature could tackle your country specific law!
require_once( "$IP/extensions/PslZendSearchLucene/PslZendSearchLucene.php");
113.210.3.154 06:56, 3 May 2013 (UTC)
$wgPslImagePath = "http://sains/mediawiki/extensions/PslZendSearchLucene/";
$wgPslWikiUrl = "http://sains/mediawiki/index.php/";
...makes no sense because "sains" is no valid domain name. Steviex2 (talk) 13:18, 3 May 2013 (UTC)
Your are also dealing with different dir names mediawiki vs. mediawiki-1.20.4. Accordingly $PslDomainDir should reflect one of that dirs. Sysdoc is no useable default term. Steviex2 (talk) 13:29, 3 May 2013 (UTC)
I'm running that on my own cpu to test out the features and various functions/extensions of mediawiki so just require to host name atm. And about the mediawiki vs mediawiki-1.20.4, i did a softlink on both of them , i changed the path around hoping that the folder path r the 1 causing the problem ... originally i pointed both of them to mediawiki. 108.171.100.64 14:19, 5 May 2013 (UTC)
I dont know what you mean with atm and never tested it with soft links. I just would install it on the most common, simpliest way (like the others) and then later if its running begin to experiment with it. 86.56.58.86 14:33, 5 May 2013 (UTC)
alright i tried reinstalling it, and at the moment stuck at step 3, same error as last time, cant figure out what's causing it.
/usr/bin/php -c /etc/php.ini /usr/local/search/ZSearch/PslZendSearchLuceneIndexer.php
Below are what it print out.
 
<?
/* This part is for command operations only, usualy you should not touch it */
setlocale(LC_ALL, 'de_CH.UTF8'); 
header('Content-Type: text/html; charset=utf-8');
$debugMode = 1;
ini_set('max_execution_time',36000000);
if($debugMode==1):
    error_reporting(E_ALL);
    ini_set("display_errors", 1);
else:
    error_reporting (E_ALL ^ E_NOTICE);
    ini_set("display_errors", 0); 
endif;
define("LINE_BREAK", "\n\n<br/>");
$argsNum = count($_SERVER['argv']);
if($argsNum>1):
    
    $wikisArray[0]['xmlSource']         = $_SERVER['argv'][1];
    $wikisArray[0]['indexName']         = $_SERVER['argv'][2];
    $wikisArray[0]['maintenanceScript'] = $_SERVER['argv'][3];
    
    if(isset($_SERVER['argv'][4])):
        $GuiFlag                        = $_SERVER['argv'][4];
    else:
        $GuiFlag                        = 0;
    endif;
    
   if(isset($_SERVER['argv'][5])):
       $wikisArray[0]['incrementUpdate']= (int)$_SERVER['argv'][5];
   else:
       $wikisArray[0]['incrementUpdate']= 0;
   endif;
   
   if(isset($_SERVER['argv'][6])):
        $wikisArray[0]['useFiles']      = $_SERVER['argv'][6];
   else:
        $wikisArray[0]['useFiles']      = "";
   endif;
   
   if(isset($_SERVER['argv'][7])):
        $wikisArray[0]['mediaDir']      = $_SERVER['argv'][7];
   else:
        $wikisArray[0]['mediaDir']      = "";
   endif;
   
   
         
else:
    
    /* This part is for you! Configure multiple Wiki-instances if needed, see examples below */
    
    $GuiFlag                            = 0;
  
    $wikisArray[0]['xmlSource']         = "/var/www/zend/sources/my_wiki_current.xml";
    $wikisArray[0]['indexName']         = "my_wiki";
    $wikisArray[0]['maintenanceScript'] = "/var/www/mediawiki/maintenance/dumpBackup.php";
    $wikisArray[0]['mediaDir']          = "/var/www/mediawiki/images";
    
            
endif;
@preg_match_all("/(Windows)(.*?)/", $_SERVER['OS'], $matched, PREG_SET_ORDER);
/* an index dir above web root */
$indexDirName                   = "psl_search_indexes";  
$PhpExecutionStringUnix         = "/usr/bin/php -c /etc/php.ini";
$PhpExecutionStringWindows      = "c:\\xampp\\php\\php.exe ";
$email                          = "info@my.reporting-mailadress.ork";
/* file formats which will be indexed */
$additionalFileFormatsArray     = array('pdf','docx','xlsx','pptx','sql','vnd','txt','xml','xmlx','csv');
if(count($matched) > 0 ):
/* modify this to fit your needs, if you are on windows */
    $webServerUser              = "";
    $webServerUserGroup         = "";
    $zendFrameworkLibraryPath   = "C:\\xampp\\htdocs/ZF/library";
    $zendLogPath                = "C:\\xampp\\htdocs\\".$indexDirName."\\";
    $applicationPath            = "C:\\xampp\\htdocs"; 
else:
/* modify this to fit your needs, if you are on unix */
    $webServerUser              = "apache";
    $webServerUserGroup         = "apache";
    $zendFrameworkLibraryPath   = "/var/www/zend/ZendFramework-1.11.15/library";
    $zendLogPath                = "/var/www/zend/".$indexDirName."/";
    $applicationPath            = "/var/www/zend/";
endif;
?>
PHP Notice: Undefined variable: wikisArray in /usr/local/search/ZSearch/PslZendSearchLuceneIndexer.php on line 34
PHP Warning: Invalid argument supplied for foreach() in /usr/local/search/ZSearch/PslZendSearchLuceneIndexer.php on line 34
line 34: foreach($wikisArray as $key => $val)
Nick1092 (talk) 08:03, 6 May 2013 (UTC)
The error message means array wikisArray is not defined which should be happen in LuceneIndexerConfig.
The second error is a side effect of the first. In line 29 auf LuceneIndexer try "echo require_once($folder."PslZendSearchLuceneIndexerConfig.php");". May be the include does not happen. You can see it if you dont get "1" as output. 86.56.58.86 10:20, 6 May 2013 (UTC)
Tested it, output is 1, which means it found the file.
Cant figure out anything wrong with the path, so i'm gonna think maybe it's the php problem?
Or might be the OS problem? i'm using RHEL, CentOS 6, mediawiki 1.20.4. But dont think this is the problem though.
Does it normally print out the content of Config.php before printing out error? Nick1092 (talk) 02:30, 8 May 2013 (UTC)
No. Steviex2 (talk) 11:43, 8 May 2013 (UTC)
Next place the array definition below the if statement to see if the error still accours. Steviex2 (talk) 11:56, 8 May 2013 (UTC)
if you mean placing
    $wikisArray[0]['xmlSource']         = "/var/www/zend/sources/my_wiki_current.xml";
    $wikisArray[0]['indexName']         = "my_wiki";
    $wikisArray[0]['maintenanceScript'] = "/var/www/mediawiki/maintenance/dumpBackup.php";
    $wikisArray[0]['mediaDir']          = "/var/www/mediawiki/images";
outside of the if statement, i tried that before doesnt work still same error.
I also tried adding this under the require_once line
if(empty($wikisArray)):
echo "empty";
else:
echo "not empty";
endif;
print out empty. Nick1092 (talk) 02:08, 9 May 2013 (UTC)
Ah now I see. The whole thing isnt parsed by the PHP-Interpreter If yu get the content of the file as output. Try to use logng opening/closing tags "<?php". You colud also check if your php.ini (both for the webserver and cli) has allow_short_tags enabled. Actually this is mostly default enabled.
cheers. 86.56.58.86 02:20, 9 May 2013 (UTC)
oh dear.. all this hustle cause the short open tags is not on...
finally got it working. haha.
thanks a lot for the help Steve and for your time too. Nick1092 (talk) 03:01, 9 May 2013 (UTC)
And we claimed a new high score for ZSL thread postings YEAH!
You are the second person reporting this config issue in 3 years. So I think its not on my first priority list. Anyway have fun with ZSL. Steviex2 (talk) 04:48, 9 May 2013 (UTC)
haha yeh, long post.. 30, make it 31
Nick1092 (talk) 05:29, 9 May 2013 (UTC)

See also

Would you please correct the link "In depth description of Zend Search Lucene for MediaWiki (German)"?! I hope to find some hints to configure a windows-server ... thank you! 62.225.157.130 12:24, 17 May 2013 (UTC)

Fixed thank you...my changes will be displayed to readers once an authorized user accepts them. Steviex2 (talk) 12:38, 17 May 2013 (UTC)

Search hit titles are being displayed with text (although rather slowly), but the links provided point to nothing. Inspecting the link properties will find empty values. Anyone have any clues to fix this? MadX (talk) 08:41, 9 August 2013 (UTC)

Could you provide a link, so I can see what happens. Steviex2 (talk) 10:16, 9 August 2013 (UTC)
Looks like I needed to append "/index.php?title=" to the following setting to make it progress:
#$wgPslWikiUrl = "http://hostname.domain.com:8027"; //before
$wgPslWikiUrl = "http://hostname.domain.com:8027/index.php?title="; //after
Now the link properties produces the value "http://hostname.domain.com:8027/index.php?title=Special:PslZendSearchLucene?pid=1420&pagpage=1" , but instead of a blank page it now errors out the "No such special page – You have requested an invalid special page" message. Without the "?pid=1420&pagpage=1" appendage the ZSL Search special page appears fine. What do the link URLs suppose to look like and how can we correct this? MadX (talk) 13:56, 9 August 2013 (UTC)

The download links to the extension seem broken. 203.167.207.202 23:14, 18 August 2013 (UTC)

Category:Talk pages using deprecated source tags