Thread:Extension talk:Lucene-search/Running the "build" script for a multilanguage farm?

I run a wiki family with multiple languages, say, en.mywiki.com, fr.mywiki.com, de.mywiki.com, etc. Each wiki has a separate database -- en_wikidb, de_wikidb, fr_wikidb, etc. -- with the same username (wikiuser) and password, but they all share a single MediaWiki code tree. In LocalSettings.php, a  statement looks at the incoming URL (e.g., fr.mywiki.com) and dynamically selects the proper database (fr_wikidb).

There is an existing lucene-search 2.1 installation that works correctly for this environment, reindexing correctly with the  script and MWSearch.

The problem:

In this environment, I am having trouble running the lucene-search 2.1.3  and   scripts. The  script produces a config.inc file with , which is not the database, because   is not running in a web context. Then the  script errors out with this:

Dumping wikidb... 2011-02-15 20:48:28: wikidb-vpw_ 5 pages (525.102/sec), 5 revs (525.102/sec), ETA 2011-02-15 20:48:28 [max 5] MediaWiki lucene-search indexer - rebuild all indexes associated with a database. Trying config file at path /root/.lsearch.conf Trying config file at path /usr/local/lucene-search-2.1.3/lsearch.conf Exception in thread "main" java.lang.RuntimeException: Index wikidb doesn't exist at org.wikimedia.lsearch.config.IndexId.get(IndexId.java:176) at org.wikimedia.lsearch.importer.BuildAll.main(BuildAll.java:91)

What is the right thing to do?


 * Run the  script 3 times, changing the database line in config.inc by hand each time to point to the right database? When I tried this, I got 3 indexes built, but according to , the indexes contained nothing (i.e., all searches return zero results). Probably because the   script is still hitting wikidb instead of en_wikidb.

Dumping en_wikidb... 2011-02-15 20:59:46: wikidb-vpw_ 5 pages (508.906/sec), 5 revs (508.906/sec), ETA 2011-02-15 20:59:46 [max 5]
 * 1) ./build

lsearch-global.conf:

[Database] en_wikidb : (single) (spell,4,2) (language,en) de_wikidb : (single) (spell,4,2) (language,de) fr_wikidb : (single) (spell,4,2) (language,fr)

[Search-Group] myserver : *

[Index] kmyserver : *

[Index-Path] : /search

[OAI] : http://myserver/w/index.php en_wikidb : http://en.mywiki.com/w/index.php de_wikidb : http://de.mywiki.com/w/index.php fr_wikidb : http://fr.mywiki.com/w/index.php

...

Thanks for any help! --Maiden taiwan 20:56, 15 February 2011 (UTC)

If you are into editing file, you should edit the dbname in config.inc (i.e. not in any of the individual files). This will make sure the right dbname is substituted where needed. However, the default scripts that come with the package are really made to make a single-wiki installation easy. If you have multiple wikis you will have to do some work yourself, possibly by reusing some of the code already available. Try googling "for loop bash". --Rainman 11:24, 17 February 2011 (UTC)
 * Thanks for your response, but when I changed config.inc (as above) to use en_wikidb, the build script still used wikidb, as you can see from this output:

# ./build Dumping en_wikidb...   2011-02-15 20:59:46:  wikidb -vpw_ 5 pages (508.906/sec), 5 revs (508.906/sec) ...

Where is the script getting "wikidb" from? LocalSettings.php? Thanks. 16:32, 17 February 2011 (UTC)