Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 53547 invoked from network); 26 Oct 2009 22:22:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 Oct 2009 22:22:20 -0000 Received: (qmail 62699 invoked by uid 500); 26 Oct 2009 22:22:19 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 62635 invoked by uid 500); 26 Oct 2009 22:22:18 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 62627 invoked by uid 99); 26 Oct 2009 22:22:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Oct 2009 22:22:18 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [85.25.71.29] (HELO mail.troja.net) (85.25.71.29) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Oct 2009 22:22:15 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.troja.net (Postfix) with ESMTP id 81A5545E278 for ; Mon, 26 Oct 2009 23:21:54 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.troja.net Received: from mail.troja.net ([127.0.0.1]) by localhost (megaira.troja.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ppSOFJvtfDI4 for ; Mon, 26 Oct 2009 23:21:44 +0100 (CET) Received: from VEGA (port-83-236-62-3.dynamic.qsc.de [83.236.62.3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.troja.net (Postfix) with ESMTPSA id E2D0645EAEE for ; Mon, 26 Oct 2009 23:21:43 +0100 (CET) From: "Uwe Schindler" To: References: <20091026220640.9B97F238890E@eris.apache.org> <4AE61E80.7010402@gmail.com> <03683293906D4BA39BC4DE2D5170ED98@VEGA> Subject: RE: svn commit: r829995 - in /lucene/java/trunk/contrib/highlighter/src/test: ./ org/apache/lucene/search/highlight/HighlighterTest.java Date: Mon, 26 Oct 2009 23:21:42 +0100 Message-ID: <5EC483A77ACB4E6DBC05952940C2F47B@VEGA> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <03683293906D4BA39BC4DE2D5170ED98@VEGA> Thread-Index: AcpWiVFr2D4IDiMLR5qZ3MSo4yN4oQAAPHPQAAARt+A= X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 By the way, as Solr updated to the latest 2.9.1 artifacts: the SolrQueryWrapper fix for highlighter is now obsolete again? Uwe > -----Original Message----- > From: Uwe Schindler [mailto:uwe@thetaphi.de] > Sent: Monday, October 26, 2009 11:19 PM > To: java-dev@lucene.apache.org > Subject: RE: svn commit: r829995 - in > /lucene/java/trunk/contrib/highlighter/src/test: ./ > org/apache/lucene/search/highlight/HighlighterTest.java > > Done. I thought I added it to the fixing issue's changes entry. > > ----- > Uwe Schindler > H.-H.-Meier-Allee 63, D-28213 Bremen > http://www.thetaphi.de > eMail: uwe@thetaphi.de > > > -----Original Message----- > > From: Mark Miller [mailto:markrmiller@gmail.com] > > Sent: Monday, October 26, 2009 11:11 PM > > To: java-dev@lucene.apache.org > > Subject: Re: svn commit: r829995 - in > > /lucene/java/trunk/contrib/highlighter/src/test: ./ > > org/apache/lucene/search/highlight/HighlighterTest.java > > > > We need a changes entry too right? > > > > uschindler@apache.org wrote: > > > Author: uschindler > > > Date: Mon Oct 26 22:06:40 2009 > > > New Revision: 829995 > > > > > > URL: http://svn.apache.org/viewvc?rev=829995&view=rev > > > Log: > > > LUCENE-1929: Merge NumericRangeQuery tests for highlighter from 2.9 > > branch. The bug was already fixed by a different impl in trunk, but the > > test was missing. > > > > > > Modified: > > > lucene/java/trunk/contrib/highlighter/src/test/ (props changed) > > > > > > lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/hi > > ghlight/HighlighterTest.java > > > > > > Propchange: lucene/java/trunk/contrib/highlighter/src/test/ > > > ---------------------------------------------------------------------- > -- > > ------ > > > --- svn:mergeinfo (added) > > > +++ svn:mergeinfo Mon Oct 26 22:06:40 2009 > > > @@ -0,0 +1,3 @@ > > > +/lucene/java/branches/lucene_2_4/contrib/highlighter/src/test:748824 > > > +/lucene/java/branches/lucene_2_9/contrib/highlighter/src/test:817269- > > 818600,825998,826775,829134,829816,829881 > > > > > > +/lucene/java/branches/lucene_2_9_back_compat_tests/contrib/highlighter/sr > > c/test:818601-821336 > > > > > > Modified: > > > lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/hi > > ghlight/HighlighterTest.java > > > URL: > > > http://svn.apache.org/viewvc/lucene/java/trunk/contrib/highlighter/src/tes > > > t/org/apache/lucene/search/highlight/HighlighterTest.java?rev=829995&r1=82 > > 9994&r2=829995&view=diff > > > > > > ========================================================================== > > ==== > > > --- > > > lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/hi > > ghlight/HighlighterTest.java (original) > > > +++ > > > lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/hi > > ghlight/HighlighterTest.java Mon Oct 26 22:06:40 2009 > > > @@ -46,6 +46,7 @@ > > > import org.apache.lucene.analysis.tokenattributes.TermAttribute; > > > import org.apache.lucene.document.Document; > > > import org.apache.lucene.document.Field; > > > +import org.apache.lucene.document.NumericField; > > > import org.apache.lucene.document.Field.Index; > > > import org.apache.lucene.document.Field.Store; > > > import org.apache.lucene.index.IndexReader; > > > @@ -60,6 +61,7 @@ > > > import org.apache.lucene.search.MultiPhraseQuery; > > > import org.apache.lucene.search.MultiSearcher; > > > import org.apache.lucene.search.MultiTermQuery; > > > +import org.apache.lucene.search.NumericRangeQuery; > > > import org.apache.lucene.search.PhraseQuery; > > > import org.apache.lucene.search.Query; > > > import org.apache.lucene.search.TermQuery; > > > @@ -88,6 +90,7 @@ > > > > > > private IndexReader reader; > > > static final String FIELD_NAME = "contents"; > > > + private static final String NUMERIC_FIELD_NAME = "nfield"; > > > private Query query; > > > RAMDirectory ramDir; > > > public IndexSearcher searcher = null; > > > @@ -302,6 +305,30 @@ > > > numHighlights == 4); > > > > > > } > > > + > > > + public void testNumericRangeQuery() throws Exception { > > > + // doesn't currently highlight, but make sure it doesn't cause > > exception either > > > + query = NumericRangeQuery.newIntRange(NUMERIC_FIELD_NAME, 2, 6, > > true, true); > > > + searcher = new IndexSearcher(ramDir, true); > > > + hits = searcher.search(query, 100); > > > + int maxNumFragmentsRequired = 2; > > > + > > > + QueryScorer scorer = new QueryScorer(query, FIELD_NAME); > > > + Highlighter highlighter = new Highlighter(this, scorer); > > > + > > > + for (int i = 0; i < hits.totalHits; i++) { > > > + String text = > > searcher.doc(hits.scoreDocs[i].doc).get(NUMERIC_FIELD_NAME); > > > + TokenStream tokenStream = analyzer.tokenStream(FIELD_NAME, new > > StringReader(text)); > > > + > > > + highlighter.setTextFragmenter(new SimpleFragmenter(40)); > > > + > > > + String result = highlighter.getBestFragments(tokenStream, text, > > maxNumFragmentsRequired, > > > + "..."); > > > + //System.out.println("\t" + result); > > > + } > > > + > > > + > > > + } > > > > > > public void testSimpleQueryScorerPhraseHighlighting2() throws > > Exception { > > > doSearching("\"text piece long\"~5"); > > > @@ -1617,7 +1644,26 @@ > > > for (int i = 0; i < texts.length; i++) { > > > addDoc(writer, texts[i]); > > > } > > > - > > > + Document doc = new Document(); > > > + NumericField nfield = new NumericField(NUMERIC_FIELD_NAME, > > Store.YES, true); > > > + nfield.setIntValue(1); > > > + doc.add(nfield); > > > + writer.addDocument(doc, analyzer); > > > + nfield = new NumericField(NUMERIC_FIELD_NAME, Store.YES, true); > > > + nfield.setIntValue(3); > > > + doc = new Document(); > > > + doc.add(nfield); > > > + writer.addDocument(doc, analyzer); > > > + nfield = new NumericField(NUMERIC_FIELD_NAME, Store.YES, true); > > > + nfield.setIntValue(5); > > > + doc = new Document(); > > > + doc.add(nfield); > > > + writer.addDocument(doc, analyzer); > > > + nfield = new NumericField(NUMERIC_FIELD_NAME, Store.YES, true); > > > + nfield.setIntValue(7); > > > + doc = new Document(); > > > + doc.add(nfield); > > > + writer.addDocument(doc, analyzer); > > > writer.optimize(); > > > writer.close(); > > > reader = IndexReader.open(ramDir, true); > > > > > > > > > > > > > > > -- > > - Mark > > > > http://www.lucidimagination.com > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org > > For additional commands, e-mail: java-dev-help@lucene.apache.org > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-dev-help@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org