lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: Document as parameter?
Date Fri, 11 Nov 2005 14:08:13 GMT

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: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message