lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r823323 - /lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/search/TestWildcard.java
Date Thu, 08 Oct 2009 20:59:05 GMT
Author: mikemccand
Date: Thu Oct  8 20:59:05 2009
New Revision: 823323

URL: http://svn.apache.org/viewvc?rev=823323&view=rev
Log:
LUCENE-1951: fix WildcardQuery to correctly rewrite single term query and prefix query

Modified:
    lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/search/TestWildcard.java

Modified: lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/search/TestWildcard.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/search/TestWildcard.java?rev=823323&r1=823322&r2=823323&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/search/TestWildcard.java
(original)
+++ lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/search/TestWildcard.java
Thu Oct  8 20:59:05 2009
@@ -67,11 +67,11 @@
       RAMDirectory indexStore = getIndexStore("field", new String[]{"nowildcard", "nowildcardx"});
       IndexSearcher searcher = new IndexSearcher(indexStore, true);
 
-      Query wq = new WildcardQuery(new Term("field", "nowildcard"));
+      MultiTermQuery wq = new WildcardQuery(new Term("field", "nowildcard"));
+      wq.setRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE);
       assertMatches(searcher, wq, 1);
 
-      wq = searcher.rewrite(wq);
-      assertTrue(wq instanceof TermQuery);
+      assertTrue(searcher.rewrite(wq) instanceof TermQuery);
   }
 
   /**



Mime
View raw message