You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by bib_lucene bib <bi...@yahoo.com> on 2005/09/26 09:57:34 UTC

Displaying Document [Highlighting Terms]

Hi All
 
I have indexed and displayed highlighted search results. [following lucene in action examples: Thanks authors]. Now I want to display the content of the file with highlighted terms.
 
An idea I could comeup with is , clicking on search result I can open stream to a document, search the text for matching strings and put <b>text</b> around the text (or css whatever).
 
What I am not sure with the above approach is if there are 100 people requesting to see the document, it will open 100 files and do the search and highlight etc....
 
Is there a elegant and better way, essentially how you guys deal when the requirement is not only to just show highlighted fragments of a doc, but also the whole document with highlighted text on clicking clicking on search results.
 
The document is indexed like this..
doc.add(Field.UnStored("content",fileText));
 
Thanks for any suggestions...
Thanks
bib

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com