cerberus yao wrote:
  Does anyone knows how to add the Lucene search results with Line
number in original source content?

When you display each hit, first scan the text and build an array containing the positions of each newline. Then use the highlighter (in contrib/highlighter) to find fragments:


  TextFragment[] frags = highlighter.getBestTextFragments(...);

Finally, display these fragments as complete lines by searching the array of line starts for the first fragment's start position to find the start line, and the last fragment's end position to find the last line.

Doug

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



Reply via email to