lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dna...@apache.org
Subject svn commit: r347995 - /lucene/java/trunk/src/test/org/apache/lucene/analysis/TestKeywordAnalyzer.java
Date Mon, 21 Nov 2005 21:46:32 GMT
Author: dnaber
Date: Mon Nov 21 13:46:26 2005
New Revision: 347995

URL: http://svn.apache.org/viewcvs?rev=347995&view=rev
Log:
avoid using deprecated QueryParser method

Modified:
    lucene/java/trunk/src/test/org/apache/lucene/analysis/TestKeywordAnalyzer.java

Modified: lucene/java/trunk/src/test/org/apache/lucene/analysis/TestKeywordAnalyzer.java
URL: http://svn.apache.org/viewcvs/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestKeywordAnalyzer.java?rev=347995&r1=347994&r2=347995&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/analysis/TestKeywordAnalyzer.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/analysis/TestKeywordAnalyzer.java Mon Nov
21 13:46:26 2005
@@ -27,7 +27,8 @@
 import org.apache.lucene.queryParser.QueryParser;
 
 public class TestKeywordAnalyzer extends TestCase {
-  RAMDirectory directory;
+  
+  private RAMDirectory directory;
   private IndexSearcher searcher;
 
   public void setUp() throws Exception {
@@ -47,13 +48,11 @@
   }
 
   public void testPerFieldAnalyzer() throws Exception {
-    PerFieldAnalyzerWrapper analyzer = new PerFieldAnalyzerWrapper(
-                                              new SimpleAnalyzer());
+    PerFieldAnalyzerWrapper analyzer = new PerFieldAnalyzerWrapper(new SimpleAnalyzer());
     analyzer.addAnalyzer("partnum", new KeywordAnalyzer());
 
-    Query query = QueryParser.parse("partnum:Q36 AND SPACE",
-                                    "description",
-                                    analyzer);
+    QueryParser queryParser = new QueryParser("description", analyzer);
+    Query query = queryParser.parse("partnum:Q36 AND SPACE");
 
     Hits hits = searcher.search(query);
     assertEquals("Q36 kept as-is",



Mime
View raw message