Ok, it looks like you will need to modify the code of LuceneIndex or AnalyzerConfig to get this analyzer to work.

I also found the full 2.4.1 jar here:

I de-compiled the jar and used jad to recreate the java files (attached).

SnowballAnalyzer has NO default constructor, but requires a String (as you have indicated) to complete the call to other classes.

But the AnalyzerConfig only reads two attributes of the <analyzer> element: @id and @class.

What would be nice is to have the AnalyzerConfig parse something like:

<analyzer class="org.apache.lucene.analysis.snowball.SnowballAnalyzer">
<property name="name" value="German"/>

But since that is not the case, there are lots of ways you could go about this, but the easiest (hack) is to import the SnowballAnalyzer to the LuceneIndex

I was able to get this to work:

import org.apache.lucene.analysis.snowball.SnowballAnalyzer;

        if (defaultAnalyzer == null)
//            defaultAnalyzer = new StandardAnalyzer();
defaultAnalyzer = new org.apache.lucene.analysis.snowball.SnowballAnalyzer("German");

<module id="lucene-index" class="org.exist.indexing.lucene.LuceneIndex"

<analyzer class="org.apache.lucene.analysis.snowball.SnowballAnalyzer"/>

This is a hack!

I wrote some code into the AnalyzerConfig. It compiled without error, but always threw an instantiate error on startup.

Maybe someone on the list can do better.


conf.xml and collection.xconf
<analyzer stemmer="German" class="org.apache.lucene.analysis.snowball.SnowballAnalyzer"/>

Code I wrote into the AnalyzerConfig class

    private final static String STEMMER_ATTRIBUTE = "stemmer";

        String stemmer = config.getAttribute(STEMMER_ATTRIBUTE);
        if(className.equalsIgnoreCase("SnowballAnalyzer")) {
            java.lang.reflect.Constructor con = clazz.getConstructor(new Class[] {String.class});
            return (Analyzer)con.newInstance(new Object[]{new String(stemmer)});
        } else {
            return (Analyzer)clazz.newInstance();
        catch exceptions:

From: Mike Ferrando <>
To: Hungerburg <>; Wolfgang Meier <>
Cc: eXist Open <>
Sent: Fri, July 30, 2010 2:57:51 PM
Subject: Re: [Exist-open] lucene snowball analyzer

You shouldn't need the import statement in

All you need is the <analyzer> element child in the <module>.

But it looks like it is a separate jar.

Try downloading the jar and put it in the lib directory and recompile.


From: Hungerburg <>
To: Wolfgang Meier <>
Cc: Mike Ferrando <>; eXist Open <>
Sent: Fri, July 30, 2010 2:41:24 PM
Subject: Re: [Exist-open] lucene snowball analyzer

Am 2010-07-30 17:13, schrieb Wolfgang Meier:
>> In the org.exist.indexing.lucene.LuceneIndex class you need to comment out
>> the Lucene StandardAnalyzer (as the default analyzer used) and put this one
>> in it.
> This should not be necessary. I'm not sure why you had to do that.
> However, in addition to collection.xconf, you can also configure the
> analyzer in the main conf.xml:
> <module id="lucene-index" class="org.exist.indexing.lucene.LuceneIndex"
>                  buffer="32">
> <analyzer class="..."/>
> </module>
> Peter, putting the module jar into
> EXIST-HOME/extensions/indexes/lucene/lib/ should indeed make it
> available on the classpath.
> Wolfgang

I think it is available on the classpath, there is no not-found-exception but a instantiation-exception. I added the import statement in and recompiled. The message remains and no index will be created:

Caused by: java.lang.InstantiationException: org.apache.lucene.analysis.snowball.SnowballAnalyzer
    at java.lang.Class.newInstance0(
    at java.lang.Class.newInstance(
    at org.exist.indexing.lucene.AnalyzerConfig.configureAnalyzer(

I will give in. it was very easy to get pdf-images and hyphenation patterns into fop. this is a tougher one. I also tried to pass some more arguments to the analyzer in collection.xconf:

<analyzer id="snowball" class="org.apache.lucene.analysis.snowball.SnowballAnalyzer" stemmer="German" locale="de"/>


-- peter