incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [1/3] git commit: Fixed the tests in the org/apache/blur/search package. Mostly import problems.
Date Thu, 18 Oct 2012 02:14:21 GMT
Updated Branches:
  refs/heads/lucene-4.0.0 4c77501b5 -> b143f5c15


Fixed the tests in the org/apache/blur/search package.  Mostly import problems.


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/b143f5c1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/b143f5c1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/b143f5c1

Branch: refs/heads/lucene-4.0.0
Commit: b143f5c15b5f056c3800cfbddae08819244366a2
Parents: 60db0cf
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Wed Oct 17 22:13:33 2012 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Wed Oct 17 22:13:33 2012 -0400

----------------------------------------------------------------------
 .../apache/blur/search/RandomSuperQueryTest.java   |    7 +++--
 .../org/apache/blur/search/SuperQueryTest.java     |   21 +++-----------
 .../apache/blur/search/TestingPagingCollector.java |    4 +-
 3 files changed, 11 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b143f5c1/src/blur-core/src/test/java/org/apache/blur/search/RandomSuperQueryTest.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/test/java/org/apache/blur/search/RandomSuperQueryTest.java
b/src/blur-core/src/test/java/org/apache/blur/search/RandomSuperQueryTest.java
index 132112d..c85eeeb 100644
--- a/src/blur-core/src/test/java/org/apache/blur/search/RandomSuperQueryTest.java
+++ b/src/blur-core/src/test/java/org/apache/blur/search/RandomSuperQueryTest.java
@@ -18,7 +18,7 @@ package org.apache.blur.search;
  */
 
 import static junit.framework.Assert.assertTrue;
-import static org.apache.blur.lucene.LuceneConstant.LUCENE_VERSION;
+import static org.apache.blur.lucene.LuceneVersionConstant.LUCENE_VERSION;
 
 import java.io.IOException;
 import java.util.Collection;
@@ -37,9 +37,10 @@ import org.apache.blur.thrift.generated.ScoreType;
 import org.apache.blur.utils.RowIndexWriter;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
 import org.apache.lucene.index.CorruptIndexException;
+import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriterConfig;
-import org.apache.lucene.queryParser.ParseException;
+import org.apache.lucene.queryparser.classic.ParseException;
 import org.apache.lucene.search.Filter;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.MatchAllDocsQuery;
@@ -77,7 +78,7 @@ public class RandomSuperQueryTest {
     System.out.print("Creating index... ");
     System.out.flush();
     Directory directory = createIndex(random, sampler);
-    IndexReader reader = IndexReader.open(directory);
+    IndexReader reader = DirectoryReader.open(directory);
     System.out.print("Running searches [" + sampler.size() + "]... ");
     System.out.flush();
     assertTrue(!sampler.isEmpty());

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b143f5c1/src/blur-core/src/test/java/org/apache/blur/search/SuperQueryTest.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/test/java/org/apache/blur/search/SuperQueryTest.java b/src/blur-core/src/test/java/org/apache/blur/search/SuperQueryTest.java
index 9acccfe..7043179 100644
--- a/src/blur-core/src/test/java/org/apache/blur/search/SuperQueryTest.java
+++ b/src/blur-core/src/test/java/org/apache/blur/search/SuperQueryTest.java
@@ -18,9 +18,7 @@ package org.apache.blur.search;
  */
 
 import static junit.framework.Assert.assertEquals;
-import static org.apache.blur.lucene.LuceneConstant.LUCENE_VERSION;
-import static org.apache.blur.utils.BlurConstants.PRIME_DOC;
-import static org.apache.blur.utils.BlurConstants.PRIME_DOC_VALUE;
+import static org.apache.blur.lucene.LuceneVersionConstant.LUCENE_VERSION;
 import static org.apache.blur.utils.BlurConstants.ROW_ID;
 import static org.apache.blur.utils.BlurUtil.newColumn;
 import static org.apache.blur.utils.BlurUtil.newRecord;
@@ -38,10 +36,10 @@ import org.apache.blur.thrift.generated.ScoreType;
 import org.apache.blur.utils.RowIndexWriter;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
 import org.apache.lucene.index.CorruptIndexException;
+import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriterConfig;
 import org.apache.lucene.index.Term;
-import org.apache.lucene.index.TermDocs;
 import org.apache.lucene.search.BooleanClause.Occur;
 import org.apache.lucene.search.BooleanQuery;
 import org.apache.lucene.search.IndexSearcher;
@@ -76,10 +74,8 @@ public class SuperQueryTest {
     booleanQuery.add(wrapSuper(new TermQuery(new Term(ADDRESS_STREET, STREET1))), Occur.MUST);
 
     Directory directory = createIndex();
-    IndexReader reader = IndexReader.open(directory);
-    printAll(new Term(PERSON_NAME, NAME1), reader);
-    printAll(new Term(ADDRESS_STREET, STREET1), reader);
-    printAll(new Term(PRIME_DOC, PRIME_DOC_VALUE), reader);
+    IndexReader reader = DirectoryReader.open(directory);
+
     IndexSearcher searcher = new IndexSearcher(reader);
     TopDocs topDocs = searcher.search(booleanQuery, 10);
     assertEquals(2, topDocs.totalHits);
@@ -173,16 +169,9 @@ public class SuperQueryTest {
     assertEquals(0.75, topDocs.scoreDocs[2].score, 0.01);
   }
 
-  private void printAll(Term term, IndexReader reader) throws IOException {
-    TermDocs termDocs = reader.termDocs(term);
-    while (termDocs.next()) {
-      System.out.println(term + "=>" + termDocs.doc());
-    }
-  }
-
   private static IndexSearcher createSearcher() throws Exception {
     Directory directory = createIndex();
-    IndexReader reader = IndexReader.open(directory);
+    IndexReader reader = DirectoryReader.open(directory);
     return new IndexSearcher(reader);
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b143f5c1/src/blur-core/src/test/java/org/apache/blur/search/TestingPagingCollector.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/test/java/org/apache/blur/search/TestingPagingCollector.java
b/src/blur-core/src/test/java/org/apache/blur/search/TestingPagingCollector.java
index 76300f4..14ae610 100644
--- a/src/blur-core/src/test/java/org/apache/blur/search/TestingPagingCollector.java
+++ b/src/blur-core/src/test/java/org/apache/blur/search/TestingPagingCollector.java
@@ -17,14 +17,14 @@ package org.apache.blur.search;
  * limitations under the License.
  */
 
-import static org.apache.blur.lucene.LuceneConstant.LUCENE_VERSION;
+import static org.apache.blur.lucene.LuceneVersionConstant.LUCENE_VERSION;
 
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.apache.blur.lucene.search.IterablePaging;
 import org.apache.blur.lucene.search.IterablePaging.ProgressRef;
 import org.apache.blur.lucene.search.IterablePaging.TotalHitsRef;
-import org.apache.lucene.analysis.KeywordAnalyzer;
+import org.apache.lucene.analysis.core.KeywordAnalyzer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.Field.Index;


Mime
View raw message