There is nothing super special that you need to do to get KStem compiled. 
However, you will need the Solr JAR file on your classpath when you compile 
KStem.

You can do this on command-line, ANT, Eclipse, etc. This will produce the class 
files. It will also be the easiest to use if you put this in its own JAR file. 
And you will need to have this JAR file on your classpath. Usually putting this 
new KSTem JAR file in the same directory as Solr will do the trick.

Next, go to schema.xml. This is where you will actually use KStem.

You will want to have something like:

    <fieldType name="myTextField" class="solr.TextField">
      <analyzer type="index">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" 
words="stopwords.txt"/>
        <filter class="solr.WordDelimiterFilterFactory" splitOnCaseChange="1" 
generateWordParts="1" generateNumberParts="1" catenateWords="1" 
catenateNumbers="1" catenateAll="1"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.KStemFilterFactory" cacheSize="20000"/>
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" 
ignoreCase="true" expand="true"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" 
words="stopwords.txt"/>
        <filter class="solr.WordDelimiterFilterFactory" splitOnCaseChange="1" 
generateWordParts="1" generateNumberParts="1" catenateWords="0" 
catenateNumbers="0" catenateAll="0"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.KStemFilterFactory" cacheSize="20000"/>
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
      </analyzer>
    </fieldType>




----- Original Message ----
From: Hung Huynh <[EMAIL PROTECTED]>
To: solr-user@lucene.apache.org
Sent: Wednesday, May 7, 2008 3:06:42 PM
Subject: How do I use KStem with Solr?

I'm a complete newbie to Solr and Java programming. I'm able to get Solr up
running. I'd like to replace Porter stemming with KStem. I have KStem
source, but I'm clueless in term of how to compile and use it.

Thanks,

HH

Reply via email to