MidCOM indexer setup notes

Here are short notes on how I installed the MidCOM indexer for a client. The client has an intranet site running on Midgard 1.6 and MidCOM 2.1.0 on Red Hat Linux 7.3.

Install MidCOM 2.3

Download MidCOM 2.3 and install it:

# cd /usr/local/share/midgard/
# wget http://www.midgard-project.org/midc...1c9/MidCOM-2.3.0.tar.bz2
# tar jxvf MidCOM-2.3.0.tar.bz2
# ln -s /usr/local/share/midgard/MidCOM-2.3.0 /usr/local/share/midgard/midcom

Install the PHP Compat PEAR package:

# pear install PHP_Compat

Upgrade the MidCOM template site installation:

# repligard -a -i MidCOM-2.3.0/midcom-template/midcom-template.xml

Note: if you are using a MultiLang-formatted database you need to install the package via Datagard installer instead.

Install the indexer

Download and install the Java 1.4.2 runtime:

# ./j2re-1_4_2_07-linux-i586-rpm.bin
# rpm -i j2re-1_4_2_07-linux-i586.rpm

Download and install Apache Lucene search engine:

# mkdir /usr/local/share/midgard/indexer
# cd /usr/local/share/midgard/indexer
# wget http://apache.intissite.com/jakarta/lucene/binaries/lucene-1.4.3.jar
# mv lucene-1.4.3.jar lucene.jar

Download and install the MidCOM indexer:

# wget http://www.nathan-syntronics.de/midc...80b/indexer.jar
# wget http://www.nathan-syntronics.de/midc...116/xml-communication-response.dtd
# wget http://www.nathan-syntronics.de/midc...c3c/xml-communication-request.dtd

Deploy the indexer

Start the indexer daemon:

# /usr/java/j2re1.4.2_07/bin/java -jar indexer.jar

Set the site to use the indexer:

  • Point your browser to http://www.example.net/midcom-admin/settings/
  • Log in as administrator
  • Set Which indexer backend to use to xmltcp

Reindex the site:

  • Point your browser to http://www.example.net/midcom-exec-midcom/reindex.php

Note: the current indexer seems to give a big number of iconv() errors if the site is in latin-1 encoding. Switch to UTF-8 instead or wait until bug 201 is resolved.

I needed to also install the mbstring PHP extension for the indexer to work.

Deploy the search engine

Once the site has been reindexed, the only thing needed for setting up the search engine is to create a new topic handled by the midcom.helper.search component.

After that, just run searches and enjoy!

Note: if content is edited outside MidCOM using tools like Aegir, you might want to run the reindexing command from cron periodically to prevent search index corruption. Content edits made in Aegir do not currently update the index.

Read more Midgard posts.