>>The reason the current highlighter is not suitable for me, is that the
>>content of the document is not stored in the index

That shouldn't present a problem.
The working code example below was from a recent email discussion I had with someone 
who was storing
text in a database. This simple example works shows highlighting working with no index 
in sight.

===Begin code====
Analyzer a = new StandardAnalyzer();
Query q = QueryParser.parse("jennifer lopez","cached",a);
String s = "the unofficial home page Britney Spears Elizabeth Hurley Kirsten Dunst 
Anna Kournikova Katie Holmes Katherine Heigl Jessica Alba Alyson Hannigan Jennifer 
Lopez Sarah Michelle Gellar";
Highlighter highlighter = new Highlighter(new QueryScorer(q));
TokenStream tokenstream = a.tokenStream("cached",new java.io.StringReader(s));
 String summary = highlighter.getBestFragments(tokenstream,s,3,"...");
System.out.println(summary);
=== end code =====

Cheers
Mark


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

Reply via email to