You can use Lucene highlighter. It lives in Lucene's contrib/ directory (not released as a separate Jar, but you can either build it, or grab it from, for example, Lucene in Action's code download). It lets you highlight search terms like this: http://www.lucenebook.com/search?query=highlighter
Otis --- Markus Fischer <[EMAIL PROTECTED]> wrote: > Hi, > > I was wondering if there's a reason why the stemmers, e.g. > GermanStemmer > are not accessible from outside the lucene package. > > When I want to highlight the search terms, I need to know which terms > > have been found. Example: when searching for "Vitamine" the > GermanStemmer produces "Vitami". "Vitami" is a word not directly > used, > but often it's "Vitamin", the noun. When I now try to highlight the > matched words solely based on the user input, I certainly won't be > able > to highlight "Vitamin" or a part of the word, since I'm not aware of > the > stemmed word. > > My frontend application is not Java, I'm only accessing Lucene > through > my package with XML-RPC. What I did now is I copied the GermanStemmer > > from lucene into my package and called it from there. > > But I'm not sure if that's a clever idea and maybe I just overlooked > a > public interface to the stemmer output? Or I'm approaching the whole > highlight search term from the wrong direction? > > thanks for any pointers, > - Markus > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]