[opencms-dev] Lucene Module

M Butcher mbutcher at grcomputing.net
Fri Sep 19 19:29:01 CEST 2003


Hi Thomas,

On Fri, 2003-09-19 at 10:26, Thomas Gick wrote:
> Hi Matt,
> 
> is it possible (with your lucene module) to modify the hitlist (links) in this
> way that the right language parameter (we use different bodies to
> edit different languages) is appended.
> 
> Example: If the search expression is found in a body named "body_en" the parameter
> lng=en should be appended to the generated link. So i know, which body
> has to be served because normalewise only the prefered language body
> of a html page is shown. In this case i want to serve the body in
> which the expression was found.
> 
> Can i do this with your module?

That depends... if you can get the body name (e.g. body_en), the you
should be able to set the parameter pretty easily by doing something
like:

String params="?lng=";
if("body_en".equals(body_name)) params += "en";
else params .= "de";

and then append 'params' to the link. You could also create a CmsObject
and then use the file ID to get information about the file from the VFS.
Or, you can always rewrite the implementations of I_DocumentFactory and
just add the language to the index.

While that last option may sound like the hardest, it shouldn't be too
bad, and it might be the fastest and best way to do it in the long run.

Hope that helps,

Matt

 

-- 
M Butcher <mbutcher at grcomputing.net>



More information about the opencms-dev mailing list