Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@www.apache.org Received: (qmail 40856 invoked from network); 29 Jun 2004 13:59:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 29 Jun 2004 13:59:54 -0000 Received: (qmail 10470 invoked by uid 500); 29 Jun 2004 13:59:35 -0000 Delivered-To: apmail-jakarta-lucene-user-archive@jakarta.apache.org Received: (qmail 10312 invoked by uid 500); 29 Jun 2004 13:59:30 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 10247 invoked by uid 99); 29 Jun 2004 13:59:30 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [203.199.26.74] (HELO daakghar.controlnet.co.in) (203.199.26.74) by apache.org (qpsmtpd/0.27.1) with SMTP; Tue, 29 Jun 2004 06:59:29 -0700 Received: from karthik ([192.168.4.1]) by dakiya.controlnet.co.in (Netscape Messaging Server 4.15) with ESMTP id I02Q3A00.VJU for ; Tue, 29 Jun 2004 19:41:34 +0530 From: "Karthik N S" To: "Lucene Users List" Subject: RE: Using Highlighter in web Demo Date: Tue, 29 Jun 2004 19:38:39 +0530 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 In-Reply-To: <20040629135700.17168.qmail@web12706.mail.yahoo.com> X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Oh! So silly of me Apologies Please Thx for the same.... -----Original Message----- From: Otis Gospodnetic [mailto:otis_gospodnetic@yahoo.com] Sent: Tuesday, June 29, 2004 7:27 PM To: Lucene Users List Subject: RE: Using Highlighter in web Demo It sounds like you don't have the Highligher Jar in your CLASSPATH at compile-time. 1. Get Highlighter from CVS 2. Build a Jar using Ant and Highligher's build.xml 3. Add the resulting Jar to CLASSPATH 4. Compile your code (the one that imports QueryScorer) That should work. Otis --- Karthik N S wrote: > Hi > Otis > > I am not able to compile the Code because the import statement for > the below > is not avaliable in the API > QueryScorer scorer = new QueryScorer(query); > > > > with regards > Karthik > > > -----Original Message----- > From: Otis Gospodnetic [mailto:otis_gospodnetic@yahoo.com] > Sent: Tuesday, June 29, 2004 6:55 PM > To: Lucene Users List > Subject: Re: Using Highlighter in web Demo > > > Karthik, I don't understand your question. > Sorting was only added in 1.4* versions, if I recall correctly. > There > was no sorting in 1.3. > > Otis > > > --- Karthik N S wrote: > > > > Hello Developer's > > > > I am NOT able to get the API for the same [1.3-final or 1.4rc4 ] > > for > > import details. > > QueryScorer scorer = new QueryScorer(query); > > > > > > just was curious to Compile and execute the same...:) > > > > > > > > Karthik > > > > > > > > > > > > > > > > -----Original Message----- > > From: Erik Hatcher [mailto:erik@ehatchersolutions.com] > > Sent: Tuesday, June 29, 2004 5:52 PM > > To: Lucene Users List > > Subject: Re: Using Highlighter in web Demo > > > > > > On Jun 28, 2004, at 5:18 PM, Hetan Shah wrote: > > > Is it possible to use highlighter successfully in the demos the > web > > > demo to be specific. Has any one tried out there? If so can they > > > explain me how to go about it any code sample is really very > > > appreciated. > > > > Straight from Lucene in Action: > > > > public class HighlightIt { > > private static final String text = > > "Contrary to popular belief, Lorem Ipsum is" + > > " not simply random text. It has roots in a piece of" + > > " classical Latin literature from 45 BC, making it over" + > > " 2000 years old. Richard McClintock, a Latin professor" + > > " at Hampden-Sydney College in Virginia, looked up one" + > > " of the more obscure Latin words, consectetur, from" + > > " a Lorem Ipsum passage, and going through the cites" + > > " of the word in classical literature, discovered the" + > > " undoubtable source. Lorem Ipsum comes from sections" + > > " 1.10.32 and 1.10.33 of \"de Finibus Bonorum et" + > > " Malorum\" (The Extremes of Good and Evil) by Cicero," + > > " written in 45 BC. This book is a treatise on the" + > > " theory of ethics, very popular during the" + > > " Renaissance. The first line of Lorem Ipsum, \"Lorem" + > > " ipsum dolor sit amet..\", comes from a line in" + > > " section 1.10.32."; // from http://www.lipsum.com/ > > > > public static void main(String[] args) throws IOException { > > String filename = args[0]; > > > > if (filename == null) { > > System.err.println("Usage: HighlightIt "); > > System.exit(-1); > > } > > > > // TermQuery query = new TermQuery(new Term("f", "ipsum")); > > PhraseQuery query = new PhraseQuery(); > > query.add(new Term("f", "lorem")); > > query.add(new Term("f", "ipsum")); > > QueryScorer scorer = new QueryScorer(query); > > SimpleHTMLFormatter formatter = > > new SimpleHTMLFormatter("", > > ""); > > Highlighter highlighter = new Highlighter(formatter, scorer); > > Fragmenter fragmenter = new SimpleFragmenter(50); > > highlighter.setTextFragmenter(fragmenter); > > > > TokenStream tokenStream = new StandardAnalyzer() > > .tokenStream("f", new StringReader(text)); > > > > String result = > > highlighter.getBestFragments(tokenStream, text, 5, "..."); > > > > FileWriter writer = new FileWriter(filename); > > writer.write(""); > > writer.write(""); > > writer.write(""); > > writer.write(result); > > writer.write(""); > > writer.close(); > > } > > } > > > > I just added the PhraseQuery in there instead of the TermQuery that > > is > > commented out. Highlighter works well with phrases also (although > > highlights each term individually, not the breadth of the phrase by > > itself). The above code runs like it says in the usage statement, > > give > > it a filename to save an HTML file that shows the terms highlighted > > in > > yellow. > > > > Erik > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org > > For additional commands, e-mail: > lucene-user-help@jakarta.apache.org > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org > > For additional commands, e-mail: > lucene-user-help@jakarta.apache.org > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: lucene-user-help@jakarta.apache.org > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: lucene-user-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org