From lucene-user-return-7186-apmail-jakarta-lucene-user-archive=jakarta.apache.org@jakarta.apache.org Tue Feb 17 22:16:44 2004 Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@www.apache.org Received: (qmail 23085 invoked from network); 17 Feb 2004 22:16:43 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 17 Feb 2004 22:16:43 -0000 Received: (qmail 58783 invoked by uid 500); 17 Feb 2004 22:16:26 -0000 Delivered-To: apmail-jakarta-lucene-user-archive@jakarta.apache.org Received: (qmail 58620 invoked by uid 500); 17 Feb 2004 22:16:25 -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 58597 invoked from network); 17 Feb 2004 22:16:25 -0000 Received: from unknown (HELO web25207.mail.ukl.yahoo.com) (217.12.10.67) by daedalus.apache.org with SMTP; 17 Feb 2004 22:16:25 -0000 Message-ID: <20040217221630.90348.qmail@web25207.mail.ukl.yahoo.com> Received: from [202.3.241.21] by web25207.mail.ukl.yahoo.com via HTTP; Tue, 17 Feb 2004 23:16:30 CET Date: Tue, 17 Feb 2004 23:16:30 +0100 (CET) From: =?iso-8859-1?q?Alex=20Botin?= Subject: Problem using highlighter package To: lucene-user@jakarta.apache.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-911029158-1077056190=:88922" Content-Transfer-Encoding: 8bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N --0-911029158-1077056190=:88922 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hi there ! I downloaded the highlighter package made available by Mark Hardwood on : http://home.clara.net/markharwood/lucene/highlight.htm I followed the instructions given on this site to use the package, but when I try to run my application, I get the following message : " Method rewrite(org.apache.lucene.index.IndexReader) not found in class org.apache.lucene.search.Query.query = query.rewrite(reader); " Then, if I remove the instruction "query = query.rewrite(reader);", I get another NoSuchMethodError for org.apache.lucene.search.TermQuery.getTerm() (A piece of my source code is at the end of this message) Does anybody have a clue to solve my problem ? And by the way, can somebody explain me what the query.rewrite() function is used for exactly ? I thank you all in advance. Alex. ... import org.apache.lucene.index.*; import org.apache.lucene.search.*; import org.apache.lucene.search.highlight.*; ... IndexReader reader = IndexReader.open(indexName); searcher = new IndexSearcher( reader ); Analyzer analyzer = new FrenchAnalyzer(); query = QueryParser.parse(queryString, "contents", analyzer); query = query.rewrite(reader); QueryHighlightExtractor highlighter = new QueryHighlightExtractor(query, new FrenchAnalyzer(), "", ""); int highlightFragmentSizeInBytes = 80; int maxNumFragmentsRequired = 4; String fragmentSeparator="..."; String highlightedSummary = highlighter.getBestFragments(summary, highlightFragmentSizeInBytes, maxNumFragmentsRequired, fragmentSeparator); For information, I added C:\Projets\Lucene\lib\highlighter.jar C:\Projets\Lucene\lib\lucene-1.3-final.jar C:\Projets\Lucene\lib\lucene-demos-1.3-final.jar to my classpath. --------------------------------- Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout ! Créez votre Yahoo! Mail --0-911029158-1077056190=:88922--