lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Highlight an Greek
Date Thu, 26 Jun 2008 07:48:56 GMT

i am having the following code to highlight a text

public String highlight(String text, String query ) throws IOException {
TermQuery query = new TermQuery(new Term("f", query));
     QueryScorer scorer = new QueryScorer(query);
     SimpleHTMLFormatter formatter =
         new SimpleHTMLFormatter("<span class=\"highlight\">",
     Highlighter highlighter = new Highlighter(formatter, scorer);
     Fragmenter fragmenter = new SimpleFragmenter(50);

     TokenStream tokenStream = new GreekAnalyzer()
         .tokenStream("f", new StringReader(text));

     String result = highlighter.getBestFragments(tokenStream, text, 5, "...");

   return result;

if i use a text with english characters works fine if i try a text  
with Greek Character i am getting en empty string as result.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message