Hi,

 I have a question about using highlighting with Lucene.
What I only want to do:
start from an xml document, by example:
<flower>
This is a beautiful yellow flower
</flower>

that I have first indexed in Lucene's index.

 And when making a query such : flower:yellow
get an XML document from the following form:

<flower>
This is a beautiful <em>yellow</em> flower
</flower>

I don't want ANYsearch function, but just gain benefit from the highlight
function in Lucene.

At first glance, I think it's quite a easy task:
1°) Download the java classes from Maik Screiber, make the few modifications
on Lucene's code.
2°) Compile the Highlight Transformer java class from article
www.cocooncenter.org
3°) Write my sitemap, as written in the same article:

<map:transformer
      logger="sitemap.transformer.highlight"
      name="highlight"
   pool-grow="2" pool-max="16" pool-min="2"
   src="nl.datagram.cocoon.transformation.HighlightTransformer"/>

<map:match pattern="flora">
    <map:generate type="file"
        src="flora.xml"/>
    <map:transform type="highlight" />
        <map:serialize/>
  </map:match>

And when pointing to the url:
http://localhost:8080/cocoon/flora?query=flower:yellow

I should have the desired document:
<flower>
This is a beautiful <em>yellow</em> flower
</flower>

Is this right, or highlighting is a much more difficult task?

Thanks for your response,
Cyril.




---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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

Reply via email to