Jump to content

Extension talk:Zend Search Lucene for MediaWiki

About this board


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

7
MWJames (talkcontribs)

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) 
Steviex2 (talkcontribs)

Hi MWJames, it currently supports UTF-8, english and german (positive tested, see main page).

Agoerlt (talkcontribs)

@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!

80.187.110.199 (talkcontribs)

Hi,

could you please mention the extension version you are using and the full error message.

This post was posted by 80.187.110.199, but signed as Steviex2.

Agoerlt (talkcontribs)

Its Version 2.0 of the extension and except for "{Server-Path}" the full error message (compare my post).

Steviex2 (talkcontribs)

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

Agoerlt (talkcontribs)

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!

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

Download links to the extension seem broken

1
203.167.207.202 (talkcontribs)

The download links to the extension seem broken.

Reply to "Download links to the extension seem broken"

Links in search hits point to nothing

3
MadX (talkcontribs)

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?

Steviex2 (talkcontribs)

Could you provide a link, so I can see what happens.

MadX (talkcontribs)

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?

Reply to "Links in search hits point to nothing"

Enhanced, more admin friendly Instructions (mediawiki 1.17.0)

8
Ucananduwill (talkcontribs)

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!

Steviex2 (talkcontribs)

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 :-).

92.41.125.1 (talkcontribs)

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! :)

203.48.50.180 (talkcontribs)

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?

Reply to "Enhanced, more admin friendly Instructions (mediawiki 1.17.0)"
62.225.157.130 (talkcontribs)

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!

Steviex2 (talkcontribs)

Fixed thank you...my changes will be displayed to readers once an authorized user accepts them.

Reply to "See also"

No search result. <Solved>

32
Nick1092 (talkcontribs)

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

Steviex2 (talkcontribs)

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.

Nick1092 (talkcontribs)

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 (talkcontribs)

Edit : Double posted

Steviex2 (talkcontribs)

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.

Nick1092 (talkcontribs)

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

Steviex2 (talkcontribs)

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.

Nick1092 (talkcontribs)

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

Steviex2 (talkcontribs)

Meanwhile it is positive tested with SMW but retrieves no special semantic data. For this purpose Solr may would be better...or customizing ZSL.

Nick1092 (talkcontribs)

hey, sorry but for some reason that link lead me.. to somewhere which i think its not suppose to be.

Steviex2 (talkcontribs)

It was the right link. Alternatively you could provide your mail address here...I dont do this.

Nick1092 (talkcontribs)

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

Steviex2 (talkcontribs)

Sorry its my custom spam protection...will check it later and send mail.

Nick1092 (talkcontribs)

no problem, i created a new email to protect my real email from spams as well.

Thanks again.

Steviex2 (talkcontribs)

I send an email.

Nick1092 (talkcontribs)

thanks.

113.210.3.154 (talkcontribs)

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 (talkcontribs)

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");
Steviex2 (talkcontribs)
Steviex2 (talkcontribs)

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.

108.171.100.64 (talkcontribs)

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.

86.56.58.86 (talkcontribs)

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.

Nick1092 (talkcontribs)

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)
86.56.58.86 (talkcontribs)

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.

Nick1092 (talkcontribs)

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?

Steviex2 (talkcontribs)

No.

Steviex2 (talkcontribs)

Next place the array definition below the if statement to see if the error still accours.

Nick1092 (talkcontribs)

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.

86.56.58.86 (talkcontribs)

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.

Nick1092 (talkcontribs)

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.

Steviex2 (talkcontribs)

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.

Reply to "No search result. <Solved>"

Blank page when searching

2
141.84.149.10 (talkcontribs)

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

Nick1092 (talkcontribs)

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

Reply to "Blank page when searching"

Fatal Error calling mb_strtolower()

3
Nick1092 (talkcontribs)

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

Steviex2 (talkcontribs)

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.

Nick1092 (talkcontribs)

thanks for the help Steviex, i'll try to configure my php for this. My mistake for missing this mbstring enable line under requirements.

Reply to "Fatal Error calling mb_strtolower()"

Indexer error when reading internal_current.xml

2
MadX (talkcontribs)

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
Steviex2 (talkcontribs)

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.

Reply to "Indexer error when reading internal_current.xml"

Question about pslpopularsearches

7
Steviex2 (talkcontribs)

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

Anyone have an idea?

Steviex2 (talkcontribs)

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?

Agoerlt (talkcontribs)

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.

Pjtait (talkcontribs)

Same here - what's the fix?

Steviex2 (talkcontribs)

Hi,

as mentioned... check the db-prefix setup in your LocalSettings.php.

2001:770:1A4:0:596:6D9D:EF67:5F59 (talkcontribs)

db-prefix is ok in LocalSettings.php no solutions yet ?

Steviex2 (talkcontribs)

The fix is the same as last year. Could you post some error output?

Reply to "Question about pslpopularsearches"