[#388] Mediawiki search Engine

Description

Summary:

Detailed description

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" ) ;
*/
General Information
Submitted by:
X L B
Date Submitted: 2012-04-13 09:56
Last Modified by: Nobody
Last Modified: 2017-11-02 20:00
Permalink: https://fusionforge.org/tracker/a_follow.php/388
Actions
Internal Fields
Data Type: Bugs
Assigned to: Nobody (None)
State: Open
Priority: 3
Extra Fields
Resolution:
none
Severity:
none
Target Release:
none
Follow-up tabs
Message  ↓
Date: 2012-04-13 10:14
Sender: Alain Peyrat

The problem you faced is, in fact, not just present with mediawiki but on the whole forge when the FTS search is used. The language setting could/should be extended to the whole project and not just the wiki. So, I think, there is a need for a more global language setting.

Date: 2012-04-13 10:01
Sender: X L B

missing file

Attachments:
Size Name Date By Download
24 KiBConversation_irc_tsearch2.txt2012-04-13 09:56
X L B
Conversation_irc_tsearch2.txt
220 bytesfusionforge-Mediawiki-SearchEngine-table-plugin-mediawiki-fts.sql2012-04-13 09:56
X L B
fusionforge-Mediawiki-SearchEngine-table-plugin-mediawiki-fts.sql
5 KiBMediawiki-SearchEngine-plugin_admin-php.patch2012-04-13 09:56
X L B
Mediawiki-SearchEngine-plugin_admin-php.patch
5 KiBMediawiki-SearchEngine-init-table-plugin_mediawiki_fts.php2012-04-13 09:56
X L B
Mediawiki-SearchEngine-init-table-plugin_mediawiki_fts.php
987 bytesMediawiki-SearchEngine-LocalSettings-php.patch2012-04-13 09:56
X L B
Mediawiki-SearchEngine-LocalSettings-php.patch
1 KiBSearchFusionforge.php2012-04-13 10:01
X L B
SearchFusionforge.php
5 KiBMediawiki-SearchEngine-create-wikis-php.patch2012-04-13 10:01
X L B
Mediawiki-SearchEngine-create-wikis-php.patch

No related commits.

Field Old Value Date By
File Added239: Mediawiki-SearchEngine-create-wikis-php.patch2012-04-13 10:01
X L B
File Added238: SearchFusionforge.php2012-04-13 10:01
X L B
File Added236: Mediawiki-SearchEngine-init-table-plugin_mediawiki_fts.php2012-04-13 09:56
X L B
File Added237: Mediawiki-SearchEngine-LocalSettings-php.patch2012-04-13 09:56
X L B
File Added234: fusionforge-Mediawiki-SearchEngine-table-plugin-mediawiki-fts.sql2012-04-13 09:56
X L B
File Added235: Mediawiki-SearchEngine-plugin_admin-php.patch2012-04-13 09:56
X L B
File Added233: Conversation_irc_tsearch2.txt2012-04-13 09:56
X L B

No relations found.