Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 41025 invoked from network); 5 Jul 2005 20:59:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Jul 2005 20:59:03 -0000 Received: (qmail 31335 invoked by uid 500); 5 Jul 2005 20:58:56 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 31308 invoked by uid 500); 5 Jul 2005 20:58:56 -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 31288 invoked by uid 99); 5 Jul 2005 20:58:56 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jul 2005 13:58:56 -0700 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 [207.245.223.231] (HELO trekspace.trekspace.com) (207.245.223.231) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jul 2005 13:58:56 -0700 Received: from trekspace.trekspace.com (trekspace@trekspace.trekspace.com [192.168.2.234]) by trekspace.trekspace.com (8.12.3/8.12.3/Debian-7.1) with ESMTP id j65KwpZZ004260 for ; Tue, 5 Jul 2005 16:58:51 -0400 Message-ID: <786160445965283803APPKVAWSEI.tlai@trekspace.com> Date: Tue, 5 Jul 2005 16:58:51 -0400 (EDT) From: Terence Lai Reply-To: Terence Lai To: java-user@lucene.apache.org Subject: Question on the Sandbox Highlighter Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Mailer: Treklogic MailTool v1.6 http://www.treklogic.com X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi, I am currently using Lucene 1.4.2 with the highighter downloaded from Lucene In Action. The Highlighter class provides the following method to highlight the terms specified in the Query: /** * Highlights chosen terms in a text, extracting the most relevant section. * The document text is analysed in chunks to record hit statistics * across the document. After accumulating stats, the fragment with the highest score * is returned * * @param tokenStream a stream of tokens identified in the text parameter, including offset information. * This is typically produced by an analyzer re-parsing a document's * text. Some work may be done on retrieving TokenStreams more efficently * by adding support for storing original text position data in the Lucene * index but this support is not currently available (as of Lucene 1.4 rc2). * @param text text to highlight terms in * * @return highlighted text fragment or null if no terms found */ public final String getBestFragment(TokenStream tokenStream, String text) throws IOException; According to the javadoc, this method only returns the most relevant section of the text. Is there any way or method to return ENTIRED text with the terms being highlighted? Thanks, Terence ---------------------------------------------------------- Get your free email account from http://www.trekspace.com Your Internet Virtual Desktop! --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org