On 11 Nov 2005, at 01:22, bib_lucene bib wrote:
Hi All
I use the following code to display search results
LuceneHitHighlighter highlighter = new LuceneHitHighlighter
(queryStr, "snippet", "body");
for (int i = 0; i < hits.size(); i++) {
Document doc = (Document) hits.get(i);
highlighter.doHighlight(doc);
out.println("SNIPPET: " + doc.get("snippet"));
Issue:
I want to give a link for each matched document, so that I can
click on the link and show the whole document instead of just the
snippet. I got a suggestion from Erik Hatcher to use NullFragmenter.
Question is how can I put the information in the link so that I can
pass this document to another HitHighLighter which is using
NullFragmenter.
I don't really understand your question, and your example is using,
apparently, your own custom classes that I'm not familiar with. How
you access the "whole" document found by searches is entirely up to
your application design. You can store information in a fields
within the Document, or you could have the original document
elsewhere and access it however appropriate, in which case you'll
want to have some key to the original document stored as a field.
Erik
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]