The mediawiki search engine doesn't work properly.
The problem is when you create a mediawiki you create a new text search configuration.
(cf script create-wikis.php : $res = dbqueryparams("CREATE TEXT SEARCH CONFIGURATION $schema.default ( COPY = pg_catalog.english )", array());)
There is a text search configuration per mediawiki, text search configuration which is a copy of pg_catalog.english,
so by default the indexation is in english (and not configurable).
The default text search configuration client side is configured in the file postgresql.conf :
# default configuration for text search
defaulttextsearchconfig = 'pgcatalog.french'
In fact the text search configuration client side is never set in fusionforge neither in mediawiki.
In our case mediawikis are indexed in english and the defaulttextsearch_config in postgresql.conf is in french,
so the result of a search is not good.
Julien talk you about this problem in september 2011 on IRC, and you have find a solution. I implement it.
(cf. Conversationirctsearch2.txt)
1) we have modified create-wikis.php
It's not necessary to create a new text search configuration each time you create a mediawiki,
so we don't create anymore a TEXT SEARCH CONFIGURATION per mediawiki's schema,
we use one of the text search configurations available in the db cluster.
By default, we configure the indexation in the language of the forge (or in english if the forge language is not available in the db cluster).
(cf create-wikis.php). For the client, by default, it's the same.
2) We worked to enable a text search configuration per mediawiki,
each group can configure a text search configuration for his own mediawiki !!!
So we propose to create a new table in gforge db which link a group to a language -> pluginmediawikifts,
fts stand for Full Text Search (cf fusionforge-Mediawiki-SearchEngine-table-plugin-mediawiki-fts.sql).
We modified pluginadmin.php which now enable to configure the language indexation of a mediawiki (cf pluginadmin.php),
the setting is stocked in pluginmediawikifts. After configuration, the replace trigger with the new language, and reindex all pages on mediawiki.
It wasn't possible to simply set the client text search configuration in LocalSettings.php (according our test),
so we have to create a new class which extends the class SearchPostgres (a native class of mediawiki).
The class SearchPostgres is call in mediawiki to query the db for a search.
To enable the client text search configuration "in live" we do 2 step :
* in LocalSettings.php
$wgSearchType='SearchFusionforge'; > set the class to use by mediawiki for a search
$wgAutoloadLocalClasses['SearchFusionforge'] = 'includes/SearchFusionforge.php';
* we create a new class SearchFusionforge which extends SearchPostgres (cf SearchFusionforge.php),
the only thing it do it's to set the text search configuration just before a request on the db
3) A script to update/reset the configuration of fts of all mediawikis on the forge
(cf Mediawiki-SearchEngine-init-table-pluginmediawikifts.php)
4) Question
in the trunk of fusionforge /trunk/src/plugins/mediawiki/bin there is a script db-upgrade.pl,
can we use it to create the table pluginmediawikifts ?
and merge fusionforge-Mediawiki-SearchEngine-table-plugin-mediawiki-fts.sql with /trunk/src/plugins/mediawiki/db/mediawiki-init.sql
/*
an error in db-upgrade.pl ?
-my @filelist = ( "/usr/share/gforge/plugins/$pluginname/lib/$pluginname-init.sql" ) ;
+my @filelist = ( "/usr/share/gforge/plugins/$pluginname/db/$pluginname-init.sql" ) ;
*/
|