I'm implementing a bilingual website using Cocoon 2.1.8. I want a search facility, so I'm trying to use the Lucene block to implement it. Since the two languages (English and German) have different stop lists, stemming rules etc., and any given word may have a different meaning depending on the language, it seems to me appropriate
to have two separate indices.

The following extracts from my sitemap show how I have tried to solve this:

<map:components>

    ....

    <map:generators>

        ....

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

<map:generator name="search-en" src="org.apache.cocoon.generation.SearchGenerator">
            <index>search/en</index>
<analyzer>org.apache.lucene.analysis.standard.StandardAnalyzer</ analyzer>
        </map:generator>

        ....

    </map:generators>

    ....

</map:components>

<map:pipelines>

    ....

    <map:pipeline>

        ....

        <map:match pattern="search">
            <map:act type="locale">
                <map:select type="parameter">
<map:parameter name="parameter-selector-test" value="{language}" />
                    <map:when test="de">
                        <map:generate type="search-de" />
                    </map:when>
                    <map:otherwise>
                        <map:generate type="search-en" />
                    </map:otherwise>
                </map:select>
            </map:act>
            <map:serialize type="xml" />
        </map:match>

        ....

    </map:pipeline>

    ....

</map:pipelines>


However, when I invoke the URI /search I get the following error from Jetty:

java.io.IOException: /private/tmp/Jetty__8888__/cocoon-files/ index not a directory

Apparently Cocoon is ignoring the <index> entry in the <map:generator> element, where I specified "search/de" for German and "search/en" for English and using the default
"index".

Can anyone give me pointers on how to deal with this problem? Do I have to take a spanner to org.apache.cocoon.generation.SearchGenerator in the Lucene block and
change something?

Steve


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to