On 27.05.2004 14:04, Harald Wehr wrote:

I have a search index that needs to be processed by a german analyzer. So I tried to configure the cocoon SearchGenerator in the sitemap:

<map:generator name="search"
   src="org.apache.cocoon.generation.SearchGenerator">
       <analyzer>
            org.apache.lucene.analysis.de.GermanAnalyzer
       </analyzer>
</map:generator>

Without success as SearchGenerator was always using the StandardAnalyser. I looked into the source code and found within the configure-method following commented code:

// get the analyzer
// Analyzer analyzer =
//LuceneCocoonHelper.getAnalyzer("org.apache.lucene.analysis.standard.StandardAnalyzer");


//        lcs.setAnalyzer(analyzer);

Later I found in the method buildHits() the static class loading of the StandardAnalyzer:

.....
lcs = (LuceneCocoonSearcher)
   this.manager.lookup(LuceneCocoonSearcher.ROLE);
Analyzer analyzer =
   LuceneCocoonHelper.getAnalyzer(
     "org.apache.lucene.analysis.standard.StandardAnalyzer");
lcs.setAnalyzer(analyzer);
.....

So it seems to me that the SearchGenerator is not as configurable as the documentation says. It seems to me that it is always using the StandardAnalyzer.

Vadim moved this code around, nearly two and half a year ago:
http://cvs.apache.org/viewcvs.cgi/cocoon-2-historical/src/java/org/apache/cocoon/generation/Attic/SearchGenerator.java?r1=1.1&r2=1.2&diff_format=h
But obviously it did not work before too. From the comment in buildHits() I guess once there was the aim to make this configurable.


Joerg

Reply via email to