Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 54841 invoked from network); 12 Nov 2005 00:40:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 Nov 2005 00:40:33 -0000 Received: (qmail 39248 invoked by uid 500); 12 Nov 2005 00:40:30 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 38364 invoked by uid 500); 12 Nov 2005 00:40:27 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 38352 invoked by uid 99); 12 Nov 2005 00:40:27 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Nov 2005 16:40:27 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [69.55.225.129] (HELO ehatchersolutions.com) (69.55.225.129) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Nov 2005 16:40:18 -0800 Received: by ehatchersolutions.com (Postfix, from userid 504) id 8B01813E2041; Fri, 11 Nov 2005 19:40:03 -0500 (EST) Received: from [192.168.1.104] (68-232-111-194.chvlva.adelphia.net [68.232.111.194]) by ehatchersolutions.com (Postfix) with ESMTP id DAFF213E2041 for ; Fri, 11 Nov 2005 19:38:54 -0500 (EST) Mime-Version: 1.0 (Apple Message framework v734) In-Reply-To: <20051111175436.84521.qmail@web31208.mail.mud.yahoo.com> References: <20051111175436.84521.qmail@web31208.mail.mud.yahoo.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <1E6CEEAC-B893-4284-9652-FF6F8E9B23DF@ehatchersolutions.com> Content-Transfer-Encoding: 7bit From: Erik Hatcher Subject: Re: Document as Paramter (Rephrased) Date: Fri, 11 Nov 2005 19:39:01 -0500 To: java-user@lucene.apache.org X-Mailer: Apple Mail (2.734) X-Spam-Checker-Version: SpamAssassin 3.0.1 (2004-10-22) on javelina X-Spam-Level: X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00, RCVD_IN_NJABL_DUL,RCVD_IN_SORBS_DUL autolearn=no version=3.0.1 X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On 11 Nov 2005, at 12:54, bib_lucene bib wrote: > My requirement is that I do a search, the results of the search are > displayed. I am displaying results by using getbestfragmets and > highlighting searched text. > > So basically the user can search and see what documents matched his > search with snippets of text shown in the result of search. > > Now the user needs to select one of the results and view the > document completely. > > What I did is along with indexing I stored the document in the ROOT > webapplication and gave a link to the file. This worked fine. > > However, now I need to display the full document with search terms > highlighted. > > As I understand now I can do this... > > 1. Read the whole document again and apply some css to highlight > terms. > > 2. Create a new Lucene Document -> Read the file -> Add file > Content to Document -> Use nullfragmenter -> Apply CSS -> Display > result. There is no need to create a new Lucene Document just to highlight text. The text you highlight does not have to be the text you indexed even. The Highlighter takes a String to highlight and a Query to extract the terms to highlight from. > Question is , is there a way I can just show the content from index > rather then parsing the document again, when the user wants to see > full document from search results page. Well, the question really comes back to you.... where is the text you want to highlight? You can store it in a Lucene index, in a database, on the filesystem, wherever. Neither Lucene nor the Highlighter are related to that decision whatsoever. So using a NullFragmenter, which I will commit to contrib/highlighter soon, use the Highlighter on the full text. If you're still having issues, send us a (brief, please!) piece of code you're using to highlight. Erik --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org