lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1143840 [14/22] - in /lucene/dev/branches/flexscoring: ./ dev-tools/eclipse/ dev-tools/idea/.idea/ dev-tools/idea/lucene/contrib/ dev-tools/idea/lucene/contrib/demo/ dev-tools/idea/lucene/contrib/highlighter/ dev-tools/idea/lucene/contrib/...
Date Thu, 07 Jul 2011 14:18:33 GMT
Modified: lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/TestSort.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/TestSort.java?rev=1143840&r1=1143839&r2=1143840&view=diff
==============================================================================
--- lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/TestSort.java (original)
+++ lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/TestSort.java Thu Jul  7 14:18:02 2011
@@ -124,7 +124,7 @@ public class TestSort extends LuceneTest
         doc.add (new Field ("contents", data[i][1], Field.Store.NO, Field.Index.ANALYZED));
         if (data[i][2] != null) {
           Field f = supportsDocValues ? 
-              IndexDocValuesField.set(new Field ("int",      data[i][2], Field.Store.NO, Field.Index.NOT_ANALYZED), ValueType.INTS)
+              IndexDocValuesField.set(new Field ("int",      data[i][2], Field.Store.NO, Field.Index.NOT_ANALYZED), ValueType.VAR_INTS)
                                : new Field ("int",      data[i][2], Field.Store.NO, Field.Index.NOT_ANALYZED);
           doc.add(f);
         }
@@ -283,44 +283,44 @@ public class TestSort extends LuceneTest
   }
   // test sorts where the type of field is specified
   public void testTypedSort() throws Exception {
-    sort.setSort (new SortField ("int", SortField.INT), SortField.FIELD_DOC );
+    sort.setSort (new SortField ("int", SortField.Type.INT), SortField.FIELD_DOC );
     assertMatches (full, queryX, sort, "IGAEC");
     assertMatches (full, queryY, sort, "DHFJB");
     
-    sort.setSort (new SortField ("float", SortField.FLOAT), SortField.FIELD_DOC );
+    sort.setSort (new SortField ("float", SortField.Type.FLOAT), SortField.FIELD_DOC );
     assertMatches (full, queryX, sort, "GCIEA");
     assertMatches (full, queryY, sort, "DHJFB");
 
-    sort.setSort (new SortField ("long", SortField.LONG), SortField.FIELD_DOC );
+    sort.setSort (new SortField ("long", SortField.Type.LONG), SortField.FIELD_DOC );
     assertMatches (full, queryX, sort, "EACGI");
     assertMatches (full, queryY, sort, "FBJHD");
 
-    sort.setSort (new SortField ("double", SortField.DOUBLE), SortField.FIELD_DOC );
+    sort.setSort (new SortField ("double", SortField.Type.DOUBLE), SortField.FIELD_DOC );
     assertMatches (full, queryX, sort, "AGICE");
     assertMatches (full, queryY, sort, "DJHBF");
     
-    sort.setSort (new SortField ("byte", SortField.BYTE), SortField.FIELD_DOC );
+    sort.setSort (new SortField ("byte", SortField.Type.BYTE), SortField.FIELD_DOC );
     assertMatches (full, queryX, sort, "CIGAE");
     assertMatches (full, queryY, sort, "DHFBJ");
 
-    sort.setSort (new SortField ("short", SortField.SHORT), SortField.FIELD_DOC );
+    sort.setSort (new SortField ("short", SortField.Type.SHORT), SortField.FIELD_DOC );
     assertMatches (full, queryX, sort, "IAGCE");
     assertMatches (full, queryY, sort, "DFHBJ");
 
-    sort.setSort (new SortField ("string", SortField.STRING), SortField.FIELD_DOC );
+    sort.setSort (new SortField ("string", SortField.Type.STRING), SortField.FIELD_DOC );
     assertMatches (full, queryX, sort, "AIGEC");
     assertMatches (full, queryY, sort, "DJHFB");
     
     if (supportsDocValues) {
-      sort.setSort (useDocValues(new SortField ("int", SortField.INT)), SortField.FIELD_DOC );
+      sort.setSort (useDocValues(new SortField ("int", SortField.Type.INT)), SortField.FIELD_DOC );
       assertMatches (full, queryX, sort, "IGAEC");
       assertMatches (full, queryY, sort, "DHFJB");
       
-      sort.setSort (useDocValues(new SortField ("float", SortField.FLOAT)), SortField.FIELD_DOC );
+      sort.setSort (useDocValues(new SortField ("float", SortField.Type.FLOAT)), SortField.FIELD_DOC );
       assertMatches (full, queryX, sort, "GCIEA");
       assertMatches (full, queryY, sort, "DHJFB");
       
-      sort.setSort (useDocValues(new SortField ("double", SortField.DOUBLE)), SortField.FIELD_DOC );
+      sort.setSort (useDocValues(new SortField ("double", SortField.Type.DOUBLE)), SortField.FIELD_DOC );
       assertMatches (full, queryX, sort, "AGICE");
       assertMatches (full, queryY, sort, "DJHBF");
     }
@@ -369,8 +369,8 @@ public class TestSort extends LuceneTest
     ScoreDoc[] result = null;
     IndexSearcher searcher = getFullStrings();
     sort.setSort(
-        new SortField("string", SortField.STRING),
-        new SortField("string2", SortField.STRING, true),
+        new SortField("string", SortField.Type.STRING),
+        new SortField("string2", SortField.Type.STRING, true),
         SortField.FIELD_DOC);
 
     result = searcher.search(new MatchAllDocsQuery(), null, 500, sort).scoreDocs;
@@ -495,19 +495,19 @@ public class TestSort extends LuceneTest
     sort.setSort(SortField.FIELD_DOC);
     assertMatches (empty, queryX, sort, "");
 
-    sort.setSort (new SortField ("int", SortField.INT), SortField.FIELD_DOC );
+    sort.setSort (new SortField ("int", SortField.Type.INT), SortField.FIELD_DOC );
     assertMatches (empty, queryX, sort, "");
     
-    sort.setSort (useDocValues(new SortField ("int", SortField.INT)), SortField.FIELD_DOC );
+    sort.setSort (useDocValues(new SortField ("int", SortField.Type.INT)), SortField.FIELD_DOC );
     assertMatches (empty, queryX, sort, "");
 
-    sort.setSort (new SortField ("string", SortField.STRING, true), SortField.FIELD_DOC );
+    sort.setSort (new SortField ("string", SortField.Type.STRING, true), SortField.FIELD_DOC );
     assertMatches (empty, queryX, sort, "");
 
-    sort.setSort (new SortField ("float", SortField.FLOAT), new SortField ("string", SortField.STRING) );
+    sort.setSort (new SortField ("float", SortField.Type.FLOAT), new SortField ("string", SortField.Type.STRING) );
     assertMatches (empty, queryX, sort, "");
     
-    sort.setSort (useDocValues(new SortField ("float", SortField.FLOAT)), new SortField ("string", SortField.STRING) );
+    sort.setSort (useDocValues(new SortField ("float", SortField.Type.FLOAT)), new SortField ("string", SortField.Type.STRING) );
     assertMatches (empty, queryX, sort, "");
   }
 
@@ -574,32 +574,32 @@ public class TestSort extends LuceneTest
 
   // test sorts in reverse
   public void testReverseSort() throws Exception {
-    sort.setSort (new SortField (null, SortField.SCORE, true), SortField.FIELD_DOC );
+    sort.setSort (new SortField (null, SortField.Type.SCORE, true), SortField.FIELD_DOC );
     assertMatches (full, queryX, sort, "IEGCA");
     assertMatches (full, queryY, sort, "JFHDB");
 
-    sort.setSort (new SortField (null, SortField.DOC, true));
+    sort.setSort (new SortField (null, SortField.Type.DOC, true));
     assertMatches (full, queryX, sort, "IGECA");
     assertMatches (full, queryY, sort, "JHFDB");
 
-    sort.setSort (new SortField ("int", SortField.INT, true) );
+    sort.setSort (new SortField ("int", SortField.Type.INT, true) );
     assertMatches (full, queryX, sort, "CAEGI");
     assertMatches (full, queryY, sort, "BJFHD");
 
-    sort.setSort (new SortField ("float", SortField.FLOAT, true) );
+    sort.setSort (new SortField ("float", SortField.Type.FLOAT, true) );
     assertMatches (full, queryX, sort, "AECIG");
     assertMatches (full, queryY, sort, "BFJHD");
     
-    sort.setSort (new SortField ("string", SortField.STRING, true) );
+    sort.setSort (new SortField ("string", SortField.Type.STRING, true) );
     assertMatches (full, queryX, sort, "CEGIA");
     assertMatches (full, queryY, sort, "BFHJD");
     
     if (supportsDocValues) {
-      sort.setSort (useDocValues(new SortField ("int", SortField.INT, true)) );
+      sort.setSort (useDocValues(new SortField ("int", SortField.Type.INT, true)) );
       assertMatches (full, queryX, sort, "CAEGI");
       assertMatches (full, queryY, sort, "BJFHD");
     
-      sort.setSort (useDocValues(new SortField ("float", SortField.FLOAT, true)) );
+      sort.setSort (useDocValues(new SortField ("float", SortField.Type.FLOAT, true)) );
       assertMatches (full, queryX, sort, "AECIG");
       assertMatches (full, queryY, sort, "BFJHD");
     }
@@ -607,62 +607,62 @@ public class TestSort extends LuceneTest
 
   // test sorting when the sort field is empty (undefined) for some of the documents
   public void testEmptyFieldSort() throws Exception {
-    sort.setSort (new SortField ("string", SortField.STRING) );
+    sort.setSort (new SortField ("string", SortField.Type.STRING) );
     assertMatches (full, queryF, sort, "ZJI");
 
-    sort.setSort (new SortField ("string", SortField.STRING, true) );
+    sort.setSort (new SortField ("string", SortField.Type.STRING, true) );
     assertMatches (full, queryF, sort, "IJZ");
     
-    sort.setSort (new SortField ("int", SortField.INT) );
+    sort.setSort (new SortField ("int", SortField.Type.INT) );
     assertMatches (full, queryF, sort, "IZJ");
 
-    sort.setSort (new SortField ("int", SortField.INT, true) );
+    sort.setSort (new SortField ("int", SortField.Type.INT, true) );
     assertMatches (full, queryF, sort, "JZI");
 
-    sort.setSort (new SortField ("float", SortField.FLOAT) );
+    sort.setSort (new SortField ("float", SortField.Type.FLOAT) );
     assertMatches (full, queryF, sort, "ZJI");
 
     if (supportsDocValues) {
-      sort.setSort (useDocValues(new SortField ("int", SortField.INT)) );
+      sort.setSort (useDocValues(new SortField ("int", SortField.Type.INT)) );
       assertMatches (full, queryF, sort, "IZJ");
     
-      sort.setSort (useDocValues(new SortField ("float", SortField.FLOAT)) );
+      sort.setSort (useDocValues(new SortField ("float", SortField.Type.FLOAT)) );
       assertMatches (full, queryF, sort, "ZJI");
     }
 
     // using a nonexisting field as first sort key shouldn't make a difference:
-    sort.setSort (new SortField ("nosuchfield", SortField.STRING),
-        new SortField ("float", SortField.FLOAT) );
+    sort.setSort (new SortField ("nosuchfield", SortField.Type.STRING),
+        new SortField ("float", SortField.Type.FLOAT) );
     assertMatches (full, queryF, sort, "ZJI");
 
-    sort.setSort (new SortField ("float", SortField.FLOAT, true) );
+    sort.setSort (new SortField ("float", SortField.Type.FLOAT, true) );
     assertMatches (full, queryF, sort, "IJZ");
 
     // When a field is null for both documents, the next SortField should be used.
                 // Works for
-    sort.setSort (new SortField ("int", SortField.INT),
-                                new SortField ("string", SortField.STRING),
-        new SortField ("float", SortField.FLOAT) );
+    sort.setSort (new SortField ("int", SortField.Type.INT),
+                                new SortField ("string", SortField.Type.STRING),
+        new SortField ("float", SortField.Type.FLOAT) );
     assertMatches (full, queryG, sort, "ZWXY");
 
     // Reverse the last criterium to make sure the test didn't pass by chance
-    sort.setSort (new SortField ("int", SortField.INT),
-                                new SortField ("string", SortField.STRING),
-        new SortField ("float", SortField.FLOAT, true) );
+    sort.setSort (new SortField ("int", SortField.Type.INT),
+                                new SortField ("string", SortField.Type.STRING),
+        new SortField ("float", SortField.Type.FLOAT, true) );
     assertMatches (full, queryG, sort, "ZYXW");
 
     // Do the same for a ParallelMultiSearcher
     ExecutorService exec = Executors.newFixedThreadPool(_TestUtil.nextInt(random, 2, 8));
     IndexSearcher parallelSearcher=new IndexSearcher (full.getIndexReader(), exec);
 
-    sort.setSort (new SortField ("int", SortField.INT),
-                                new SortField ("string", SortField.STRING),
-        new SortField ("float", SortField.FLOAT) );
+    sort.setSort (new SortField ("int", SortField.Type.INT),
+                                new SortField ("string", SortField.Type.STRING),
+        new SortField ("float", SortField.Type.FLOAT) );
     assertMatches (parallelSearcher, queryG, sort, "ZWXY");
 
-    sort.setSort (new SortField ("int", SortField.INT),
-                                new SortField ("string", SortField.STRING),
-        new SortField ("float", SortField.FLOAT, true) );
+    sort.setSort (new SortField ("int", SortField.Type.INT),
+                                new SortField ("string", SortField.Type.STRING),
+        new SortField ("float", SortField.Type.FLOAT, true) );
     assertMatches (parallelSearcher, queryG, sort, "ZYXW");
     parallelSearcher.close();
     exec.shutdown();
@@ -671,13 +671,13 @@ public class TestSort extends LuceneTest
 
   // test sorts using a series of fields
   public void testSortCombos() throws Exception {
-    sort.setSort (new SortField ("int", SortField.INT), new SortField ("float", SortField.FLOAT) );
+    sort.setSort (new SortField ("int", SortField.Type.INT), new SortField ("float", SortField.Type.FLOAT) );
     assertMatches (full, queryX, sort, "IGEAC");
 
-    sort.setSort (new SortField ("int", SortField.INT, true), new SortField (null, SortField.DOC, true) );
+    sort.setSort (new SortField ("int", SortField.Type.INT, true), new SortField (null, SortField.Type.DOC, true) );
     assertMatches (full, queryX, sort, "CEAGI");
 
-    sort.setSort (new SortField ("float", SortField.FLOAT), new SortField ("string", SortField.STRING) );
+    sort.setSort (new SortField ("float", SortField.Type.FLOAT), new SortField ("string", SortField.Type.STRING) );
     assertMatches (full, queryX, sort, "GICEA");
   }
 
@@ -940,88 +940,88 @@ public class TestSort extends LuceneTest
     String expected = isFull ? "ABCDEFGHIJ" : "ACEGIBDFHJ";
     assertMatches(multi, queryA, sort, expected);
 
-    sort.setSort(new SortField ("int", SortField.INT));
+    sort.setSort(new SortField ("int", SortField.Type.INT));
     expected = isFull ? "IDHFGJABEC" : "IDHFGJAEBC";
     assertMatches(multi, queryA, sort, expected);
 
-    sort.setSort(new SortField ("int", SortField.INT), SortField.FIELD_DOC);
+    sort.setSort(new SortField ("int", SortField.Type.INT), SortField.FIELD_DOC);
     expected = isFull ? "IDHFGJABEC" : "IDHFGJAEBC";
     assertMatches(multi, queryA, sort, expected);
 
-    sort.setSort(new SortField("int", SortField.INT));
+    sort.setSort(new SortField("int", SortField.Type.INT));
     expected = isFull ? "IDHFGJABEC" : "IDHFGJAEBC";
     assertMatches(multi, queryA, sort, expected);
     
-    sort.setSort(new SortField ("float", SortField.FLOAT), SortField.FIELD_DOC);
+    sort.setSort(new SortField ("float", SortField.Type.FLOAT), SortField.FIELD_DOC);
     assertMatches(multi, queryA, sort, "GDHJCIEFAB");
 
-    sort.setSort(new SortField("float", SortField.FLOAT));
+    sort.setSort(new SortField("float", SortField.Type.FLOAT));
     assertMatches(multi, queryA, sort, "GDHJCIEFAB");
 
-    sort.setSort(new SortField("string", SortField.STRING));
+    sort.setSort(new SortField("string", SortField.Type.STRING));
     assertMatches(multi, queryA, sort, "DJAIHGFEBC");
 
-    sort.setSort(new SortField("int", SortField.INT, true));
+    sort.setSort(new SortField("int", SortField.Type.INT, true));
     expected = isFull ? "CABEJGFHDI" : "CAEBJGFHDI";
     assertMatches(multi, queryA, sort, expected);
 
-    sort.setSort(new SortField("float", SortField.FLOAT, true));
+    sort.setSort(new SortField("float", SortField.Type.FLOAT, true));
     assertMatches(multi, queryA, sort, "BAFECIJHDG");
 
-    sort.setSort(new SortField("string", SortField.STRING, true));
+    sort.setSort(new SortField("string", SortField.Type.STRING, true));
     assertMatches(multi, queryA, sort, "CBEFGHIAJD");
 
-    sort.setSort(new SortField("int", SortField.INT),new SortField("float", SortField.FLOAT));
+    sort.setSort(new SortField("int", SortField.Type.INT),new SortField("float", SortField.Type.FLOAT));
     assertMatches(multi, queryA, sort, "IDHFGJEABC");
 
-    sort.setSort(new SortField("float", SortField.FLOAT),new SortField("string", SortField.STRING));
+    sort.setSort(new SortField("float", SortField.Type.FLOAT),new SortField("string", SortField.Type.STRING));
     assertMatches(multi, queryA, sort, "GDHJICEFAB");
 
-    sort.setSort(new SortField ("int", SortField.INT));
+    sort.setSort(new SortField ("int", SortField.Type.INT));
     assertMatches(multi, queryF, sort, "IZJ");
 
-    sort.setSort(new SortField ("int", SortField.INT, true));
+    sort.setSort(new SortField ("int", SortField.Type.INT, true));
     assertMatches(multi, queryF, sort, "JZI");
 
-    sort.setSort(new SortField ("float", SortField.FLOAT));
+    sort.setSort(new SortField ("float", SortField.Type.FLOAT));
     assertMatches(multi, queryF, sort, "ZJI");
 
-    sort.setSort(new SortField ("string", SortField.STRING));
+    sort.setSort(new SortField ("string", SortField.Type.STRING));
     assertMatches(multi, queryF, sort, "ZJI");
 
-    sort.setSort(new SortField ("string", SortField.STRING, true));
+    sort.setSort(new SortField ("string", SortField.Type.STRING, true));
     assertMatches(multi, queryF, sort, "IJZ");
 
     if (supportsDocValues) {
-      sort.setSort(useDocValues(new SortField ("int", SortField.INT)));
+      sort.setSort(useDocValues(new SortField ("int", SortField.Type.INT)));
       expected = isFull ? "IDHFGJABEC" : "IDHFGJAEBC";
       assertMatches(multi, queryA, sort, expected);
 
-      sort.setSort(useDocValues(new SortField ("int", SortField.INT)), SortField.FIELD_DOC);
+      sort.setSort(useDocValues(new SortField ("int", SortField.Type.INT)), SortField.FIELD_DOC);
       expected = isFull ? "IDHFGJABEC" : "IDHFGJAEBC";
       assertMatches(multi, queryA, sort, expected);
 
-      sort.setSort(useDocValues(new SortField("int", SortField.INT)));
+      sort.setSort(useDocValues(new SortField("int", SortField.Type.INT)));
       expected = isFull ? "IDHFGJABEC" : "IDHFGJAEBC";
       assertMatches(multi, queryA, sort, expected);
     
-      sort.setSort(useDocValues(new SortField ("float", SortField.FLOAT)), SortField.FIELD_DOC);
+      sort.setSort(useDocValues(new SortField ("float", SortField.Type.FLOAT)), SortField.FIELD_DOC);
       assertMatches(multi, queryA, sort, "GDHJCIEFAB");
 
-      sort.setSort(useDocValues(new SortField("float", SortField.FLOAT)));
+      sort.setSort(useDocValues(new SortField("float", SortField.Type.FLOAT)));
       assertMatches(multi, queryA, sort, "GDHJCIEFAB");
     
-      sort.setSort(useDocValues(new SortField("int", SortField.INT, true)));
+      sort.setSort(useDocValues(new SortField("int", SortField.Type.INT, true)));
       expected = isFull ? "CABEJGFHDI" : "CAEBJGFHDI";
       assertMatches(multi, queryA, sort, expected);
     
-      sort.setSort(useDocValues(new SortField("int", SortField.INT)), useDocValues(new SortField("float", SortField.FLOAT)));
+      sort.setSort(useDocValues(new SortField("int", SortField.Type.INT)), useDocValues(new SortField("float", SortField.Type.FLOAT)));
       assertMatches(multi, queryA, sort, "IDHFGJEABC");
     
-      sort.setSort(useDocValues(new SortField ("int", SortField.INT)));
+      sort.setSort(useDocValues(new SortField ("int", SortField.Type.INT)));
       assertMatches(multi, queryF, sort, "IZJ");
 
-      sort.setSort(useDocValues(new SortField ("int", SortField.INT, true)));
+      sort.setSort(useDocValues(new SortField ("int", SortField.Type.INT, true)));
       assertMatches(multi, queryF, sort, "JZI");
     }
     
@@ -1071,7 +1071,7 @@ public class TestSort extends LuceneTest
     IndexReader r = IndexReader.open(w, true);
     w.close();
     IndexSearcher s = newSearcher(r);
-    TopDocs hits = s.search(new TermQuery(new Term("t", "1")), null, 10, new Sort(new SortField("f", SortField.STRING)));
+    TopDocs hits = s.search(new TermQuery(new Term("t", "1")), null, 10, new Sort(new SortField("f", SortField.Type.STRING)));
     assertEquals(2, hits.totalHits);
     // null sorts first
     assertEquals(1, hits.scoreDocs[0].doc);
@@ -1094,7 +1094,7 @@ public class TestSort extends LuceneTest
     writer.optimize(); // enforce one segment to have a higher unique term count in all cases
     writer.close();
     sort.setSort(
-        new SortField("string", SortField.STRING),
+        new SortField("string", SortField.Type.STRING),
         SortField.FIELD_DOC );
     // this should not throw AIOOBE or RuntimeEx
     IndexSearcher searcher = new IndexSearcher(indexStore, true);

Modified: lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/TestTermVectors.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/TestTermVectors.java?rev=1143840&r1=1143839&r2=1143840&view=diff
==============================================================================
--- lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/TestTermVectors.java (original)
+++ lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/TestTermVectors.java Thu Jul  7 14:18:02 2011
@@ -254,7 +254,7 @@ public class TestTermVectors extends Luc
       TermsEnum terms = fields.terms();
       while(terms.next() != null) {
         String text = terms.term().utf8ToString();
-        docs = terms.docs(MultiFields.getDeletedDocs(knownSearcher.reader), docs);
+        docs = terms.docs(MultiFields.getLiveDocs(knownSearcher.reader), docs);
         
         while (docs.nextDoc() != DocsEnum.NO_MORE_DOCS) {
           int docId = docs.docID();

Modified: lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java?rev=1143840&r1=1143839&r2=1143840&view=diff
==============================================================================
--- lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java (original)
+++ lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java Thu Jul  7 14:18:02 2011
@@ -26,7 +26,7 @@ import org.apache.lucene.document.Field;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.index.RandomIndexWriter;
-import org.apache.lucene.queryParser.QueryParser;
+import org.apache.lucene.index.Term;
 import org.apache.lucene.search.TimeLimitingCollector.TimeExceededException;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.LuceneTestCase;
@@ -84,13 +84,17 @@ public class TestTimeLimitingCollector e
     iw.close();
     searcher = newSearcher(reader);
 
-    String qtxt = "one";
+    BooleanQuery booleanQuery = new BooleanQuery();
+    booleanQuery.add(new TermQuery(new Term(FIELD_NAME, "one")), BooleanClause.Occur.SHOULD);
     // start from 1, so that the 0th doc never matches
     for (int i = 1; i < docText.length; i++) {
-      qtxt += ' ' + docText[i]; // large query so that search will be longer
+      String[] docTextParts = docText[i].split("\\s+");
+      for (String docTextPart : docTextParts) { // large query so that search will be longer
+        booleanQuery.add(new TermQuery(new Term(FIELD_NAME, docTextPart)), BooleanClause.Occur.SHOULD);
+      }
     }
-    QueryParser queryParser = new QueryParser(TEST_VERSION_CURRENT, FIELD_NAME, new MockAnalyzer(random));
-    query = queryParser.parse(qtxt);
+
+    query = booleanQuery;
     
     // warm the searcher
     searcher.search(query, null, 1000);

Modified: lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/TestTopDocsMerge.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/TestTopDocsMerge.java?rev=1143840&r1=1143839&r2=1143840&view=diff
==============================================================================
--- lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/TestTopDocsMerge.java (original)
+++ lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/TestTopDocsMerge.java Thu Jul  7 14:18:02 2011
@@ -133,16 +133,16 @@ public class TestTopDocsMerge extends Lu
     }
 
     final List<SortField> sortFields = new ArrayList<SortField>();
-    sortFields.add(new SortField("string", SortField.STRING, true));
-    sortFields.add(new SortField("string", SortField.STRING, false));
-    sortFields.add(new SortField("int", SortField.INT, true));
-    sortFields.add(new SortField("int", SortField.INT, false));
-    sortFields.add(new SortField("float", SortField.FLOAT, true));
-    sortFields.add(new SortField("float", SortField.FLOAT, false));
-    sortFields.add(new SortField(null, SortField.SCORE, true));
-    sortFields.add(new SortField(null, SortField.SCORE, false));
-    sortFields.add(new SortField(null, SortField.DOC, true));
-    sortFields.add(new SortField(null, SortField.DOC, false));
+    sortFields.add(new SortField("string", SortField.Type.STRING, true));
+    sortFields.add(new SortField("string", SortField.Type.STRING, false));
+    sortFields.add(new SortField("int", SortField.Type.INT, true));
+    sortFields.add(new SortField("int", SortField.Type.INT, false));
+    sortFields.add(new SortField("float", SortField.Type.FLOAT, true));
+    sortFields.add(new SortField("float", SortField.Type.FLOAT, false));
+    sortFields.add(new SortField(null, SortField.Type.SCORE, true));
+    sortFields.add(new SortField(null, SortField.Type.SCORE, false));
+    sortFields.add(new SortField(null, SortField.Type.DOC, true));
+    sortFields.add(new SortField(null, SortField.Type.DOC, false));
 
     final int[] docStarts = new int[subSearchers.length];
     int docBase = 0;

Modified: lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/TestWildcard.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/TestWildcard.java?rev=1143840&r1=1143839&r2=1143840&view=diff
==============================================================================
--- lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/TestWildcard.java (original)
+++ lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/TestWildcard.java Thu Jul  7 14:18:02 2011
@@ -28,7 +28,6 @@ import org.apache.lucene.index.MultiFiel
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.index.Terms;
-import org.apache.lucene.queryParser.QueryParser;
 
 import java.io.IOException;
 
@@ -268,32 +267,74 @@ public class TestWildcard
    */
   public void testParsingAndSearching() throws Exception {
     String field = "content";
-    QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, field, new MockAnalyzer(random));
-    qp.setAllowLeadingWildcard(true);
     String docs[] = {
         "\\ abcdefg1",
         "\\79 hijklmn1",
         "\\\\ opqrstu1",
     };
+
     // queries that should find all docs
-    String matchAll[] = {
-        "*", "*1", "**1", "*?", "*?1", "?*1", "**", "***", "\\\\*"
+    Query matchAll[] = {
+        new WildcardQuery(new Term(field, "*")),
+        new WildcardQuery(new Term(field, "*1")),
+        new WildcardQuery(new Term(field, "**1")),
+        new WildcardQuery(new Term(field, "*?")),
+        new WildcardQuery(new Term(field, "*?1")),
+        new WildcardQuery(new Term(field, "?*1")),
+        new WildcardQuery(new Term(field, "**")),
+        new WildcardQuery(new Term(field, "***")),
+        new WildcardQuery(new Term(field, "\\\\*"))
     };
+
     // queries that should find no docs
-    String matchNone[] = {
-        "a*h", "a?h", "*a*h", "?a", "a?",
+    Query matchNone[] = {
+        new WildcardQuery(new Term(field, "a*h")),
+        new WildcardQuery(new Term(field, "a?h")),
+        new WildcardQuery(new Term(field, "*a*h")),
+        new WildcardQuery(new Term(field, "?a")),
+        new WildcardQuery(new Term(field, "a?"))
     };
-    // queries that should be parsed to prefix queries
-    String matchOneDocPrefix[][] = {
-        {"a*", "ab*", "abc*", }, // these should find only doc 0 
-        {"h*", "hi*", "hij*", "\\\\7*"}, // these should find only doc 1
-        {"o*", "op*", "opq*", "\\\\\\\\*"}, // these should find only doc 2
+
+    PrefixQuery matchOneDocPrefix[][] = {
+        {new PrefixQuery(new Term(field, "a")),
+         new PrefixQuery(new Term(field, "ab")),
+         new PrefixQuery(new Term(field, "abc"))}, // these should find only doc 0
+
+        {new PrefixQuery(new Term(field, "h")),
+         new PrefixQuery(new Term(field, "hi")),
+         new PrefixQuery(new Term(field, "hij")),
+         new PrefixQuery(new Term(field, "\\7"))}, // these should find only doc 1
+
+        {new PrefixQuery(new Term(field, "o")),
+         new PrefixQuery(new Term(field, "op")),
+         new PrefixQuery(new Term(field, "opq")),
+         new PrefixQuery(new Term(field, "\\\\"))}, // these should find only doc 2
     };
-    // queries that should be parsed to wildcard queries
-    String matchOneDocWild[][] = {
-        {"*a*", "*ab*", "*abc**", "ab*e*", "*g?", "*f?1", "abc**"}, // these should find only doc 0
-        {"*h*", "*hi*", "*hij**", "hi*k*", "*n?", "*m?1", "hij**"}, // these should find only doc 1
-        {"*o*", "*op*", "*opq**", "op*q*", "*u?", "*t?1", "opq**"}, // these should find only doc 2
+
+    WildcardQuery matchOneDocWild[][] = {
+
+        {new WildcardQuery(new Term(field, "*a*")), // these should find only doc 0
+            new WildcardQuery(new Term(field, "*ab*")),
+            new WildcardQuery(new Term(field, "*abc**")),
+            new WildcardQuery(new Term(field, "ab*e*")),
+            new WildcardQuery(new Term(field, "*g?")),
+            new WildcardQuery(new Term(field, "*f?1"))},
+
+        {new WildcardQuery(new Term(field, "*h*")), // these should find only doc 1
+            new WildcardQuery(new Term(field, "*hi*")),
+            new WildcardQuery(new Term(field, "*hij**")),
+            new WildcardQuery(new Term(field, "hi*k*")),
+            new WildcardQuery(new Term(field, "*n?")),
+            new WildcardQuery(new Term(field, "*m?1")),
+            new WildcardQuery(new Term(field, "hij**"))},
+
+        {new WildcardQuery(new Term(field, "*o*")), // these should find only doc 2
+            new WildcardQuery(new Term(field, "*op*")),
+            new WildcardQuery(new Term(field, "*opq**")),
+            new WildcardQuery(new Term(field, "op*q*")),
+            new WildcardQuery(new Term(field, "*u?")),
+            new WildcardQuery(new Term(field, "*t?1")),
+            new WildcardQuery(new Term(field, "opq**"))}
     };
 
     // prepare the index
@@ -311,43 +352,35 @@ public class TestWildcard
     IndexSearcher searcher = new IndexSearcher(dir, true);
     
     // test queries that must find all
-    for (int i = 0; i < matchAll.length; i++) {
-      String qtxt = matchAll[i];
-      Query q = qp.parse(qtxt);
-      if (VERBOSE) System.out.println("matchAll: qtxt="+qtxt+" q="+q+" "+q.getClass().getName());
+    for (Query q : matchAll) {
+      if (VERBOSE) System.out.println("matchAll: q=" + q + " " + q.getClass().getName());
       ScoreDoc[] hits = searcher.search(q, null, 1000).scoreDocs;
-      assertEquals(docs.length,hits.length);
+      assertEquals(docs.length, hits.length);
     }
     
     // test queries that must find none
-    for (int i = 0; i < matchNone.length; i++) {
-      String qtxt = matchNone[i];
-      Query q = qp.parse(qtxt);
-      if (VERBOSE) System.out.println("matchNone: qtxt="+qtxt+" q="+q+" "+q.getClass().getName());
+    for (Query q : matchNone) {
+      if (VERBOSE) System.out.println("matchNone: q=" + q + " " + q.getClass().getName());
       ScoreDoc[] hits = searcher.search(q, null, 1000).scoreDocs;
-      assertEquals(0,hits.length);
+      assertEquals(0, hits.length);
     }
 
-    // test queries that must be prefix queries and must find only one doc
+    // thest the prefi queries find only one doc
     for (int i = 0; i < matchOneDocPrefix.length; i++) {
       for (int j = 0; j < matchOneDocPrefix[i].length; j++) {
-        String qtxt = matchOneDocPrefix[i][j];
-        Query q = qp.parse(qtxt);
-        if (VERBOSE) System.out.println("match 1 prefix: doc="+docs[i]+" qtxt="+qtxt+" q="+q+" "+q.getClass().getName());
-        assertEquals(PrefixQuery.class, q.getClass());
+        Query q = matchOneDocPrefix[i][j];
+        if (VERBOSE) System.out.println("match 1 prefix: doc="+docs[i]+" q="+q+" "+q.getClass().getName());
         ScoreDoc[] hits = searcher.search(q, null, 1000).scoreDocs;
         assertEquals(1,hits.length);
         assertEquals(i,hits[0].doc);
       }
     }
 
-    // test queries that must be wildcard queries and must find only one doc
-    for (int i = 0; i < matchOneDocPrefix.length; i++) {
+    // test the wildcard queries find only one doc
+    for (int i = 0; i < matchOneDocWild.length; i++) {
       for (int j = 0; j < matchOneDocWild[i].length; j++) {
-        String qtxt = matchOneDocWild[i][j];
-        Query q = qp.parse(qtxt);
-        if (VERBOSE) System.out.println("match 1 wild: doc="+docs[i]+" qtxt="+qtxt+" q="+q+" "+q.getClass().getName());
-        assertEquals(WildcardQuery.class, q.getClass());
+        Query q = matchOneDocWild[i][j];
+        if (VERBOSE) System.out.println("match 1 wild: doc="+docs[i]+" q="+q+" "+q.getClass().getName());
         ScoreDoc[] hits = searcher.search(q, null, 1000).scoreDocs;
         assertEquals(1,hits.length);
         assertEquals(i,hits[0].doc);

Modified: lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/payloads/TestPayloadTermQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/payloads/TestPayloadTermQuery.java?rev=1143840&r1=1143839&r2=1143840&view=diff
==============================================================================
--- lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/payloads/TestPayloadTermQuery.java (original)
+++ lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/payloads/TestPayloadTermQuery.java Thu Jul  7 14:18:02 2011
@@ -45,6 +45,8 @@ import org.apache.lucene.index.Term;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
 
 import java.io.Reader;
 import java.io.IOException;
@@ -55,15 +57,15 @@ import java.io.IOException;
  *
  **/
 public class TestPayloadTermQuery extends LuceneTestCase {
-  private IndexSearcher searcher;
-  private IndexReader reader;
-  private SimilarityProvider similarityProvider = new BoostingSimilarityProvider();
-  private byte[] payloadField = new byte[]{1};
-  private byte[] payloadMultiField1 = new byte[]{2};
-  private byte[] payloadMultiField2 = new byte[]{4};
-  protected Directory directory;
+  private static IndexSearcher searcher;
+  private static IndexReader reader;
+  private static SimilarityProvider similarityProvider = new BoostingSimilarityProvider();
+  private static final byte[] payloadField = new byte[]{1};
+  private static final byte[] payloadMultiField1 = new byte[]{2};
+  private static final byte[] payloadMultiField2 = new byte[]{4};
+  protected static Directory directory;
 
-  private class PayloadAnalyzer extends Analyzer {
+  private static class PayloadAnalyzer extends Analyzer {
 
 
     @Override
@@ -74,7 +76,7 @@ public class TestPayloadTermQuery extend
     }
   }
 
-  private class PayloadFilter extends TokenFilter {
+  private static class PayloadFilter extends TokenFilter {
     String fieldName;
     int numSeen = 0;
     
@@ -107,9 +109,8 @@ public class TestPayloadTermQuery extend
     }
   }
 
-  @Override
-  public void setUp() throws Exception {
-    super.setUp();
+  @BeforeClass
+  public static void beforeClass() throws Exception {
     directory = newDirectory();
     RandomIndexWriter writer = new RandomIndexWriter(random, directory, 
         newIndexWriterConfig(TEST_VERSION_CURRENT, new PayloadAnalyzer())
@@ -131,12 +132,14 @@ public class TestPayloadTermQuery extend
     searcher.setSimilarityProvider(similarityProvider);
   }
 
-  @Override
-  public void tearDown() throws Exception {
+  @AfterClass
+  public static void afterClass() throws Exception {
     searcher.close();
+    searcher = null;
     reader.close();
+    reader = null;
     directory.close();
-    super.tearDown();
+    directory = null;
   }
 
   public void test() throws IOException {

Modified: lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java?rev=1143840&r1=1143839&r2=1143840&view=diff
==============================================================================
--- lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java (original)
+++ lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java Thu Jul  7 14:18:02 2011
@@ -25,7 +25,6 @@ import org.apache.lucene.index.IndexRead
 import org.apache.lucene.index.IndexReader.ReaderContext;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Term;
-import org.apache.lucene.queryParser.QueryParser;
 import org.apache.lucene.search.CheckHits;
 import org.apache.lucene.search.Explanation;
 import org.apache.lucene.search.IndexSearcher;
@@ -42,8 +41,6 @@ public class TestNearSpansOrdered extend
   protected IndexReader reader;
 
   public static final String FIELD = "field";
-  public static final QueryParser qp =
-    new QueryParser(TEST_VERSION_CURRENT, FIELD, new MockAnalyzer(random));
 
   @Override
   public void tearDown() throws Exception {

Modified: lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/spans/TestSpanMultiTermQueryWrapper.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/spans/TestSpanMultiTermQueryWrapper.java?rev=1143840&r1=1143839&r2=1143840&view=diff
==============================================================================
--- lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/spans/TestSpanMultiTermQueryWrapper.java (original)
+++ lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/search/spans/TestSpanMultiTermQueryWrapper.java Thu Jul  7 14:18:02 2011
@@ -72,6 +72,14 @@ public class TestSpanMultiTermQueryWrapp
     assertEquals(1, searcher.search(sfq, 10).totalHits);
   }
   
+  public void testPrefix() throws Exception {
+    WildcardQuery wq = new WildcardQuery(new Term("field", "extrem*"));
+    SpanQuery swq = new SpanMultiTermQueryWrapper<WildcardQuery>(wq);
+    // will only match "jumps over extremely very lazy broxn dog"
+    SpanFirstQuery sfq = new SpanFirstQuery(swq, 3);
+    assertEquals(1, searcher.search(sfq, 10).totalHits);
+  }
+  
   public void testFuzzy() throws Exception {
     FuzzyQuery fq = new FuzzyQuery(new Term("field", "broan"));
     SpanQuery sfq = new SpanMultiTermQueryWrapper<FuzzyQuery>(fq);

Modified: lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/util/TestBitVector.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/util/TestBitVector.java?rev=1143840&r1=1143839&r2=1143840&view=diff
==============================================================================
--- lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/util/TestBitVector.java (original)
+++ lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/util/TestBitVector.java Thu Jul  7 14:18:02 2011
@@ -170,9 +170,10 @@ public class TestBitVector extends Lucen
       MockDirectoryWrapper d = new  MockDirectoryWrapper(random, new RAMDirectory());
       d.setPreventDoubleWrite(false);
       BitVector bv = new BitVector(size);
+      bv.invertAll();
       for (int i=0; i<count1; i++) {
-        bv.set(i);
-        assertEquals(i+1,bv.count());
+        bv.clear(i);
+        assertEquals(i+1,size-bv.count());
       }
       bv.write(d, "TESTBV");
       // gradually increase number of set bits
@@ -180,8 +181,8 @@ public class TestBitVector extends Lucen
         BitVector bv2 = new BitVector(d, "TESTBV");
         assertTrue(doCompare(bv,bv2));
         bv = bv2;
-        bv.set(i);
-        assertEquals(i+1,bv.count());
+        bv.clear(i);
+        assertEquals(i+1,size-bv.count());
         bv.write(d, "TESTBV");
       }
       // now start decreasing number of set bits
@@ -189,8 +190,8 @@ public class TestBitVector extends Lucen
         BitVector bv2 = new BitVector(d, "TESTBV");
         assertTrue(doCompare(bv,bv2));
         bv = bv2;
-        bv.clear(i);
-        assertEquals(i,bv.count());
+        bv.set(i);
+        assertEquals(i,size-bv.count());
         bv.write(d, "TESTBV");
       }
     }
@@ -211,70 +212,4 @@ public class TestBitVector extends Lucen
         }
         return equal;
     }
-    
-    private static int[] subsetPattern = new int[] { 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1 };
-    
-    /**
-     * Tests BitVector.subset() against the above pattern
-     */
-    public void testSubset() {
-    	doTestSubset(0, 0);
-    	doTestSubset(0, 20);
-    	doTestSubset(0, 7);
-    	doTestSubset(0, 8);
-    	doTestSubset(0, 9);
-    	doTestSubset(0, 15);
-    	doTestSubset(0, 16);
-    	doTestSubset(0, 17);
-    	doTestSubset(1, 7);
-    	doTestSubset(1, 8);
-    	doTestSubset(1, 9);
-    	doTestSubset(1, 15);
-    	doTestSubset(1, 16);
-    	doTestSubset(1, 17);
-    	doTestSubset(2, 20);
-    	doTestSubset(3, 20);
-    	doTestSubset(4, 20);
-    	doTestSubset(5, 20);
-    	doTestSubset(6, 20);
-    	doTestSubset(7, 14);
-    	doTestSubset(7, 15);
-    	doTestSubset(7, 16);
-    	doTestSubset(8, 15);
-    	doTestSubset(9, 20);
-    	doTestSubset(10, 20);
-    	doTestSubset(11, 20);
-    	doTestSubset(12, 20);
-    	doTestSubset(13, 20);
-    }
-    
-    /**
-     * Compare a subset against the corresponding portion of the test pattern
-     */
-    private void doTestSubset(int start, int end) {
-    	BitVector full = createSubsetTestVector();
-    	BitVector subset = full.subset(start, end);
-    	assertEquals(end - start, subset.size());
-    	int count = 0;
-    	for (int i = start, j = 0; i < end; i++, j++) {
-    		if (subsetPattern[i] == 1) {
-    			count++;
-    			assertTrue(subset.get(j));
-    		} else {
-    			assertFalse(subset.get(j));
-    		}
-    	}
-    	assertEquals(count, subset.count());
-    }
-    
-    private BitVector createSubsetTestVector() {
-    	BitVector bv = new BitVector(subsetPattern.length);
-    	for (int i = 0; i < subsetPattern.length; i++) {
-    		if (subsetPattern[i] == 1) {
-    			bv.set(i);
-    		}
-    	}
-    	return bv;
-    }
-    
 }

Modified: lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/util/TestOpenBitSet.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/util/TestOpenBitSet.java?rev=1143840&r1=1143839&r2=1143840&view=diff
==============================================================================
--- lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/util/TestOpenBitSet.java (original)
+++ lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/util/TestOpenBitSet.java Thu Jul  7 14:18:02 2011
@@ -29,6 +29,20 @@ public class TestOpenBitSet extends Luce
       if (a.get(i) != b.get(i)) {
         fail("mismatch: BitSet=["+i+"]="+a.get(i));
       }
+      if (a.get(i) != b.get((long) i)) {
+        fail("mismatch: BitSet=["+i+"]="+a.get(i));
+      }
+    }
+  }
+
+  void doGetFast(BitSet a, OpenBitSet b, int max) {
+    for (int i=0; i<max; i++) {
+      if (a.get(i) != b.fastGet(i)) {
+        fail("mismatch: BitSet=["+i+"]="+a.get(i));
+      }
+      if (a.get(i) != b.fastGet((long) i)) {
+        fail("mismatch: BitSet=["+i+"]="+a.get(i));
+      }
     }
   }
 
@@ -41,6 +55,43 @@ public class TestOpenBitSet extends Luce
     } while (aa>=0);
   }
 
+  void doNextSetBitLong(BitSet a, OpenBitSet b) {
+    int aa=-1,bb=-1;
+    do {
+      aa = a.nextSetBit(aa+1);
+      bb = (int) b.nextSetBit((long) (bb+1));
+      assertEquals(aa,bb);
+    } while (aa>=0);
+  }
+
+  void doPrevSetBit(BitSet a, OpenBitSet b) {
+    int aa = a.size() + random.nextInt(100);
+    int bb = aa;
+    do {
+      // aa = a.prevSetBit(aa-1);
+      aa--;
+      while ((aa >= 0) && (! a.get(aa))) {
+      	aa--;
+      }
+      bb = b.prevSetBit(bb-1);
+      assertEquals(aa,bb);
+    } while (aa>=0);
+  }
+
+  void doPrevSetBitLong(BitSet a, OpenBitSet b) {
+    int aa = a.size() + random.nextInt(100);
+    int bb = aa;
+    do {
+      // aa = a.prevSetBit(aa-1);
+      aa--;
+      while ((aa >= 0) && (! a.get(aa))) {
+      	aa--;
+      }
+      bb = (int) b.prevSetBit((long) (bb-1));
+      assertEquals(aa,bb);
+    } while (aa>=0);
+  }
+
   // test interleaving different OpenBitSetIterator.next()/skipTo()
   void doIterate(BitSet a, OpenBitSet b, int mode) {
     if (mode==1) doIterate1(a, b);
@@ -85,9 +136,19 @@ public class TestOpenBitSet extends Luce
           idx = random.nextInt(sz);
           a.set(idx);
           b.fastSet(idx);
+          
+          idx = random.nextInt(sz);
+          a.set(idx);
+          b.fastSet((long) idx);
+          
           idx = random.nextInt(sz);
           a.clear(idx);
           b.fastClear(idx);
+          
+          idx = random.nextInt(sz);
+          a.clear(idx);
+          b.fastClear((long) idx);
+          
           idx = random.nextInt(sz);
           a.flip(idx);
           b.fastFlip(idx);
@@ -96,6 +157,14 @@ public class TestOpenBitSet extends Luce
           boolean val2 = b.flipAndGet(idx);
           assertTrue(val != val2);
 
+          idx = random.nextInt(sz);
+          a.flip(idx);
+          b.fastFlip((long) idx);
+
+          val = b.flipAndGet((long) idx);
+          val2 = b.flipAndGet((long) idx);
+          assertTrue(val != val2);
+
           val = b.getAndSet(idx);
           assertTrue(val2 == val);
           assertTrue(b.get(idx));
@@ -107,6 +176,7 @@ public class TestOpenBitSet extends Luce
 
       // test that the various ways of accessing the bits are equivalent
       doGet(a,b);
+      doGetFast(a, b, sz);
 
       // test ranges, including possible extension
       int fromIndex, toIndex;
@@ -122,15 +192,22 @@ public class TestOpenBitSet extends Luce
       aa = (BitSet)a.clone(); aa.clear(fromIndex,toIndex);
       bb = (OpenBitSet)b.clone(); bb.clear(fromIndex,toIndex);
 
-      doNextSetBit(aa,bb);  // a problem here is from clear() or nextSetBit
+      doNextSetBit(aa,bb); // a problem here is from clear() or nextSetBit
+      doNextSetBitLong(aa,bb);
+      
+      doPrevSetBit(aa,bb);
+      doPrevSetBitLong(aa,bb);
 
       fromIndex = random.nextInt(sz+80);
       toIndex = fromIndex + random.nextInt((sz>>1)+1);
       aa = (BitSet)a.clone(); aa.set(fromIndex,toIndex);
       bb = (OpenBitSet)b.clone(); bb.set(fromIndex,toIndex);
 
-      doNextSetBit(aa,bb);  // a problem here is from set() or nextSetBit     
-
+      doNextSetBit(aa,bb); // a problem here is from set() or nextSetBit
+      doNextSetBitLong(aa,bb);
+    
+      doPrevSetBit(aa,bb);
+      doPrevSetBitLong(aa,bb);
 
       if (a0 != null) {
         assertEquals( a.equals(a0), b.equals(b0));
@@ -168,7 +245,7 @@ public class TestOpenBitSet extends Luce
       b0=b;
     }
   }
-
+  
   // large enough to flush obvious bugs, small enough to run in <.5 sec as part of a
   // larger testsuite.
   public void testSmall() {
@@ -176,12 +253,13 @@ public class TestOpenBitSet extends Luce
     doRandomSets(atLeast(1200), atLeast(1000), 2);
   }
 
+  // uncomment to run a bigger test (~2 minutes).
+  /*
   public void testBig() {
-    // uncomment to run a bigger test (~2 minutes).
-    // rand = newRandom();
-    // doRandomSets(2000,200000, 1);
-    // doRandomSets(2000,200000, 2);
+    doRandomSets(2000,200000, 1);
+    doRandomSets(2000,200000, 2);
   }
+  */
 
   public void testEquals() {
     OpenBitSet b1 = new OpenBitSet(1111);
@@ -205,26 +283,6 @@ public class TestOpenBitSet extends Luce
     assertFalse(b1.equals(new Object()));
   }
   
-  public void testBitUtils()
-  {
-    long num = 100000;
-    assertEquals( 5, BitUtil.ntz(num) );
-    assertEquals( 5, BitUtil.ntz2(num) );
-    assertEquals( 5, BitUtil.ntz3(num) );
-    
-    num = 10;
-    assertEquals( 1, BitUtil.ntz(num) );
-    assertEquals( 1, BitUtil.ntz2(num) );
-    assertEquals( 1, BitUtil.ntz3(num) );
-
-    for (int i=0; i<64; i++) {
-      num = 1L << i;
-      assertEquals( i, BitUtil.ntz(num) );
-      assertEquals( i, BitUtil.ntz2(num) );
-      assertEquals( i, BitUtil.ntz3(num) );
-    }
-  }
-
   public void testHashCodeEquals() {
     OpenBitSet bs1 = new OpenBitSet(200);
     OpenBitSet bs2 = new OpenBitSet(64);
@@ -233,6 +291,35 @@ public class TestOpenBitSet extends Luce
     assertEquals(bs1, bs2);
     assertEquals(bs1.hashCode(), bs2.hashCode());
   } 
+
+  
+  private OpenBitSet makeOpenBitSet(int[] a) {
+    OpenBitSet bs = new OpenBitSet();
+    for (int e: a) {
+      bs.set(e);
+    }
+    return bs;
+  }
+
+  private BitSet makeBitSet(int[] a) {
+    BitSet bs = new BitSet();
+    for (int e: a) {
+      bs.set(e);
+    }
+    return bs;
+  }
+
+  private void checkPrevSetBitArray(int [] a) {
+    OpenBitSet obs = makeOpenBitSet(a);
+    BitSet bs = makeBitSet(a);
+    doPrevSetBit(bs, obs);
+  }
+
+  public void testPrevSetBit() {
+    checkPrevSetBitArray(new int[] {});
+    checkPrevSetBitArray(new int[] {0});
+    checkPrevSetBitArray(new int[] {0,2});
+  }
 }
 
 

Modified: lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/util/TestVersionComparator.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/util/TestVersionComparator.java?rev=1143840&r1=1143839&r2=1143840&view=diff
==============================================================================
--- lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/util/TestVersionComparator.java (original)
+++ lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/util/TestVersionComparator.java Thu Jul  7 14:18:02 2011
@@ -43,5 +43,10 @@ public class TestVersionComparator exten
     
     assertTrue(comp.compare("1.10", "1.9") > 0);
     assertTrue(comp.compare("1.9", "1.10") < 0);
+    
+    assertTrue(comp.compare("0", "1.0") < 0);
+    assertTrue(comp.compare("00", "1.0") < 0);
+    assertTrue(comp.compare("-1.0", "1.0") < 0);
+    assertTrue(comp.compare("3.0", Integer.toString(Integer.MIN_VALUE)) > 0);
   }
 }

Modified: lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/util/fst/TestFSTs.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/util/fst/TestFSTs.java?rev=1143840&r1=1143839&r2=1143840&view=diff
==============================================================================
--- lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/util/fst/TestFSTs.java (original)
+++ lucene/dev/branches/flexscoring/lucene/src/test/org/apache/lucene/util/fst/TestFSTs.java Thu Jul  7 14:18:02 2011
@@ -588,7 +588,13 @@ public class TestFSTs extends LuceneTest
               // ok doesn't exist
               //System.out.println("  seek " + inputToString(inputMode, term));
               final IntsRefFSTEnum.InputOutput<T> seekResult;
-              if (random.nextBoolean()) {
+              if (random.nextInt(3) == 0) {
+                if (VERBOSE) {
+                  System.out.println("  do non-exist seekExact term=" + inputToString(inputMode, term));
+                }
+                seekResult = fstEnum.seekExact(term);
+                pos = -1;
+              } else if (random.nextBoolean()) {
                 if (VERBOSE) {
                   System.out.println("  do non-exist seekFloor term=" + inputToString(inputMode, term));
                 }
@@ -625,7 +631,12 @@ public class TestFSTs extends LuceneTest
           // seek to term that does exist:
           InputOutput<T> pair = pairs.get(random.nextInt(pairs.size()));
           final IntsRefFSTEnum.InputOutput<T> seekResult;
-          if (random.nextBoolean()) {
+          if (random.nextInt(3) == 2) {
+            if (VERBOSE) {
+              System.out.println("  do exists seekExact term=" + inputToString(inputMode, pair.input));
+            }
+            seekResult = fstEnum.seekExact(pair.input);
+          } else if (random.nextBoolean()) {
             if (VERBOSE) {
               System.out.println("  do exists seekFloor " + inputToString(inputMode, pair.input));
             }
@@ -703,12 +714,12 @@ public class TestFSTs extends LuceneTest
 
             if (random.nextBoolean()) {
               if (VERBOSE) {
-                System.out.println("  do advanceCeil(" + inputToString(inputMode, pairs.get(upto).input) + ")");
+                System.out.println("  do seekCeil(" + inputToString(inputMode, pairs.get(upto).input) + ")");
               }
               isDone = fstEnum.seekCeil(pairs.get(upto).input) == null;
             } else {
               if (VERBOSE) {
-                System.out.println("  do advanceFloor(" + inputToString(inputMode, pairs.get(upto).input) + ")");
+                System.out.println("  do seekFloor(" + inputToString(inputMode, pairs.get(upto).input) + ")");
               }
               isDone = fstEnum.seekFloor(pairs.get(upto).input) == null;
             }
@@ -963,7 +974,7 @@ public class TestFSTs extends LuceneTest
 
   @Nightly
   public void testBigSet() throws IOException {
-    testRandomWords(atLeast(50000), atLeast(1));
+    testRandomWords(_TestUtil.nextInt(random, 50000, 60000), atLeast(1));
   }
 
   private static String inputToString(int inputMode, IntsRef term) {
@@ -980,7 +991,8 @@ public class TestFSTs extends LuceneTest
   // file, up until a time limit
   public void testRealTerms() throws Exception {
 
-    if (CodecProvider.getDefault().getDefaultFieldCodec().equals("SimpleText")) {
+    final String defaultCodec = CodecProvider.getDefault().getDefaultFieldCodec();
+    if (defaultCodec.equals("SimpleText") || defaultCodec.equals("Memory")) {
       // no
       CodecProvider.getDefault().setDefaultFieldCodec("Standard");
     }
@@ -1060,7 +1072,7 @@ public class TestFSTs extends LuceneTest
             System.out.println("TEST: seek " + randomTerm.utf8ToString() + " " + randomTerm);
           }
 
-          final TermsEnum.SeekStatus seekResult = termsEnum.seek(randomTerm);
+          final TermsEnum.SeekStatus seekResult = termsEnum.seekCeil(randomTerm);
           final BytesRefFSTEnum.InputOutput fstSeekResult = fstEnum.seekCeil(randomTerm);
 
           if (seekResult == TermsEnum.SeekStatus.END) {

Modified: lucene/dev/branches/flexscoring/modules/analysis/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/flexscoring/modules/analysis/CHANGES.txt?rev=1143840&r1=1143839&r2=1143840&view=diff
==============================================================================
--- lucene/dev/branches/flexscoring/modules/analysis/CHANGES.txt (original)
+++ lucene/dev/branches/flexscoring/modules/analysis/CHANGES.txt Thu Jul  7 14:18:02 2011
@@ -33,7 +33,11 @@ API Changes
    in half. (Robert Muir)
    
 New Features
-   
+
+ * LUCENE-2341: A new analyzer/ filter: Morfologik - a dictionary-driven lemmatizer 
+   (accurate stemmer) for Polish (includes morphosyntactic annotations).
+   (Michał Dybizbański, Dawid Weiss)
+
  * LUCENE-2413: Consolidated Solr analysis components into common. 
    New features from Solr now available to Lucene users include:
    - o.a.l.analysis.commongrams: Constructs n-grams for frequently occurring terms

Modified: lucene/dev/branches/flexscoring/modules/analysis/LICENSE.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/flexscoring/modules/analysis/LICENSE.txt?rev=1143840&r1=1143839&r2=1143840&view=diff
==============================================================================
--- lucene/dev/branches/flexscoring/modules/analysis/LICENSE.txt (original)
+++ lucene/dev/branches/flexscoring/modules/analysis/LICENSE.txt Thu Jul  7 14:18:02 2011
@@ -263,3 +263,80 @@ HOWEVER CAUSED AND ON ANY THEORY OF LIAB
 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 SUCH DAMAGE.
+
+The following license applies to the Morfologik project:
+
+Copyright (c) 2006 Dawid Weiss
+Copyright (c) 2007-2011 Dawid Weiss, Marcin Miłkowski
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, 
+are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, 
+    this list of conditions and the following disclaimer.
+    
+    * Redistributions in binary form must reproduce the above copyright notice, 
+    this list of conditions and the following disclaimer in the documentation 
+    and/or other materials provided with the distribution.
+    
+    * Neither the name of Morfologik nor the names of its contributors 
+    may be used to endorse or promote products derived from this software 
+    without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+---
+
+The dictionary comes from Morfologik project. Morfologik uses data from 
+Polish ispell/myspell dictionary hosted at http://www.sjp.pl/slownik/en/ and 
+is licenced on the terms of (inter alia) LGPL and Creative Commons 
+ShareAlike. The part-of-speech tags were added in Morfologik project and
+are not found in the data from sjp.pl. The tagset is similar to IPI PAN
+tagset.
+
+---
+
+The following license applies to the Morfeusz project,
+used by org.apache.lucene.analysis.morfologik.
+
+BSD-licensed dictionary of Polish (SGJP)
+http://sgjp.pl/morfeusz/
+
+Copyright © 2011 Zygmunt Saloni, Włodzimierz Gruszczyński, 
+	    	 Marcin Woliński, Robert Wołosz
+
+All rights reserved.
+
+Redistribution and  use in  source and binary  forms, with  or without
+modification, are permitted provided that the following conditions are
+met:
+
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the
+   distribution.
+
+THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDERS “AS IS” AND ANY EXPRESS
+OR  IMPLIED WARRANTIES,  INCLUDING, BUT  NOT LIMITED  TO,  THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED.  IN NO EVENT  SHALL COPYRIGHT  HOLDERS OR  CONTRIBUTORS BE
+LIABLE FOR  ANY DIRECT,  INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES  (INCLUDING, BUT NOT LIMITED  TO, PROCUREMENT OF
+SUBSTITUTE  GOODS OR  SERVICES;  LOSS  OF USE,  DATA,  OR PROFITS;  OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED  AND ON ANY THEORY OF LIABILITY,
+WHETHER IN  CONTRACT, STRICT LIABILITY, OR  TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Modified: lucene/dev/branches/flexscoring/modules/analysis/NOTICE.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/flexscoring/modules/analysis/NOTICE.txt?rev=1143840&r1=1143839&r2=1143840&view=diff
==============================================================================
--- lucene/dev/branches/flexscoring/modules/analysis/NOTICE.txt (original)
+++ lucene/dev/branches/flexscoring/modules/analysis/NOTICE.txt Thu Jul  7 14:18:02 2011
@@ -62,3 +62,12 @@ WordBreakTestUnicode_*.java (under modul
 is derived from Unicode data such as the Unicode Character Database. 
 See http://unicode.org/copyright.html for more details.
 
+The Morfologik analyzer (morfologik) includes BSD-licensed software
+developed by Dawid Weiss and Marcin Miłkowski (http://morfologik.blogspot.com/).
+
+Morfologik uses data from Polish ispell/myspell dictionary
+(http://www.sjp.pl/slownik/en/) licenced on the terms of (inter alia)
+LGPL and Creative Commons ShareAlike.
+
+Morfologic includes data from BSD-licensed dictionary of Polish (SGJP)
+(http://sgjp.pl/morfeusz/)

Modified: lucene/dev/branches/flexscoring/modules/analysis/README.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/flexscoring/modules/analysis/README.txt?rev=1143840&r1=1143839&r2=1143840&view=diff
==============================================================================
--- lucene/dev/branches/flexscoring/modules/analysis/README.txt (original)
+++ lucene/dev/branches/flexscoring/modules/analysis/README.txt Thu Jul  7 14:18:02 2011
@@ -35,11 +35,15 @@ lucene-analyzers-stempel-XX.jar
   An add-on analysis library that contains a universal algorithmic stemmer,
   including tables for the Polish language.
 
+lucene-analyzers-morfologik-XX.jar
+  An analyzer using the Morfologik stemming library.
+
 common/src/java
 icu/src/java
 phonetic/src/java
 smartcn/src/java
 stempel/src/java
+morfologik/src/java
   The source code for the ffve libraries.
 
 common/src/test
@@ -47,4 +51,5 @@ icu/src/test
 phonetic/src/test
 smartcn/src/test
 stempel/src/test
+morfologik/src/test
   Unit tests for the five libraries.

Modified: lucene/dev/branches/flexscoring/modules/analysis/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/flexscoring/modules/analysis/build.xml?rev=1143840&r1=1143839&r2=1143840&view=diff
==============================================================================
--- lucene/dev/branches/flexscoring/modules/analysis/build.xml (original)
+++ lucene/dev/branches/flexscoring/modules/analysis/build.xml Thu Jul  7 14:18:02 2011
@@ -25,6 +25,7 @@
       - icu: Analyzers that use functionality from ICU
       - smartcn:	Smart Analyzer for Simplified Chinese Text
       - stempel:	Algorithmic Stemmer for Polish
+      - morfologik:	Morfologik Stemmer
   </description>
 
   <target name="common">
@@ -47,8 +48,12 @@
     <ant dir="stempel" />
   </target>
 
+  <target name="morfologik">
+    <ant dir="morfologik" />
+  </target>
+
   <target name="default" depends="compile"/>
-  <target name="compile" depends="common,icu,phonetic,smartcn,stempel" />
+  <target name="compile" depends="common,icu,phonetic,smartcn,stempel,morfologik" />
 
   <target name="clean">
     <ant dir="common" target="clean" />
@@ -56,6 +61,7 @@
     <ant dir="phonetic" target="clean" />
     <ant dir="smartcn" target="clean" />
     <ant dir="stempel" target="clean" />
+    <ant dir="morfologik" target="clean" />
   </target>
   <target name="validate">
     <ant dir="common" target="validate" />
@@ -63,6 +69,7 @@
     <ant dir="phonetic" target="validate" />
     <ant dir="smartcn" target="validate" />
     <ant dir="stempel" target="validate" />
+    <ant dir="morfologik" target="validate" />
   </target>
   <target name="compile-core">
     <ant dir="common" target="compile-core" />
@@ -70,6 +77,7 @@
     <ant dir="phonetic" target="compile-core" />
     <ant dir="smartcn" target="compile-core" />
     <ant dir="stempel" target="compile-core" />
+    <ant dir="morfologik" target="compile-core" />
   </target>
   <target name="compile-test">
     <ant dir="common" target="compile-test" />
@@ -77,6 +85,7 @@
     <ant dir="phonetic" target="compile-test" />
     <ant dir="smartcn" target="compile-test" />
     <ant dir="stempel" target="compile-test" />
+    <ant dir="morfologik" target="compile-test" />
   </target>
   <target name="test">
     <ant dir="common" target="test" />
@@ -84,6 +93,7 @@
     <ant dir="phonetic" target="test" />
     <ant dir="smartcn" target="test" />
     <ant dir="stempel" target="test" />
+    <ant dir="morfologik" target="test" />
   </target>
 
   <target name="build-artifacts-and-tests" depends="default,compile-test" />
@@ -94,6 +104,7 @@
     <ant dir="phonetic" target="dist-maven" />
     <ant dir="smartcn" target="dist-maven" />
     <ant dir="stempel" target="dist-maven" />
+    <ant dir="morfologik" target="dist-maven" />
   </target>  	
 
   <target name="javadocs">
@@ -102,6 +113,7 @@
     <ant dir="phonetic" target="javadocs" />
     <ant dir="smartcn" target="javadocs" />
     <ant dir="stempel" target="javadocs" />
+    <ant dir="morfologik" target="javadocs" />
   </target>  	
 
   <target name="javadocs-index.html">
@@ -110,6 +122,7 @@
     <ant dir="phonetic" target="javadocs-index.html" />
     <ant dir="smartcn" target="javadocs-index.html" />
     <ant dir="stempel" target="javadocs-index.html" />
+    <ant dir="morfologik" target="javadocs-index.html" />
   </target>
 	
 </project>

Modified: lucene/dev/branches/flexscoring/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestClassicAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/flexscoring/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestClassicAnalyzer.java?rev=1143840&r1=1143839&r2=1143840&view=diff
==============================================================================
--- lucene/dev/branches/flexscoring/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestClassicAnalyzer.java (original)
+++ lucene/dev/branches/flexscoring/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestClassicAnalyzer.java Thu Jul  7 14:18:02 2011
@@ -281,7 +281,7 @@ public class TestClassicAnalyzer extends
     // Make sure position is still incremented when
     // massive term is skipped:
     DocsAndPositionsEnum tps = MultiFields.getTermPositionsEnum(reader,
-                                                                MultiFields.getDeletedDocs(reader),
+                                                                MultiFields.getLiveDocs(reader),
                                                                 "content",
                                                                 new BytesRef("another"));
     assertTrue(tps.nextDoc() != DocsEnum.NO_MORE_DOCS);

Modified: lucene/dev/branches/flexscoring/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestKeywordAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/flexscoring/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestKeywordAnalyzer.java?rev=1143840&r1=1143839&r2=1143840&view=diff
==============================================================================
--- lucene/dev/branches/flexscoring/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestKeywordAnalyzer.java (original)
+++ lucene/dev/branches/flexscoring/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestKeywordAnalyzer.java Thu Jul  7 14:18:02 2011
@@ -83,12 +83,12 @@ public class TestKeywordAnalyzer extends
 
     IndexReader reader = IndexReader.open(dir, true);
     DocsEnum td = MultiFields.getTermDocsEnum(reader,
-                                              MultiFields.getDeletedDocs(reader),
+                                              MultiFields.getLiveDocs(reader),
                                               "partnum",
                                               new BytesRef("Q36"));
     assertTrue(td.nextDoc() != DocsEnum.NO_MORE_DOCS);
     td = MultiFields.getTermDocsEnum(reader,
-                                     MultiFields.getDeletedDocs(reader),
+                                     MultiFields.getLiveDocs(reader),
                                      "partnum",
                                      new BytesRef("Q37"));
     assertTrue(td.nextDoc() != DocsEnum.NO_MORE_DOCS);

Modified: lucene/dev/branches/flexscoring/modules/analysis/common/src/test/org/apache/lucene/collation/CollationTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/flexscoring/modules/analysis/common/src/test/org/apache/lucene/collation/CollationTestBase.java?rev=1143840&r1=1143839&r2=1143840&view=diff
==============================================================================
--- lucene/dev/branches/flexscoring/modules/analysis/common/src/test/org/apache/lucene/collation/CollationTestBase.java (original)
+++ lucene/dev/branches/flexscoring/modules/analysis/common/src/test/org/apache/lucene/collation/CollationTestBase.java Thu Jul  7 14:18:02 2011
@@ -228,16 +228,16 @@ public abstract class CollationTestBase 
     Query queryX = new TermQuery(new Term ("contents", "x"));
     Query queryY = new TermQuery(new Term ("contents", "y"));
     
-    sort.setSort(new SortField("US", SortField.STRING));
+    sort.setSort(new SortField("US", SortField.Type.STRING));
     assertMatches(searcher, queryY, sort, usResult);
 
-    sort.setSort(new SortField("France", SortField.STRING));
+    sort.setSort(new SortField("France", SortField.Type.STRING));
     assertMatches(searcher, queryX, sort, frResult);
 
-    sort.setSort(new SortField("Sweden", SortField.STRING));
+    sort.setSort(new SortField("Sweden", SortField.Type.STRING));
     assertMatches(searcher, queryY, sort, svResult);
 
-    sort.setSort(new SortField("Denmark", SortField.STRING));
+    sort.setSort(new SortField("Denmark", SortField.Type.STRING));
     assertMatches(searcher, queryY, sort, dkResult);
   }
     

Modified: lucene/dev/branches/flexscoring/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/DeleteByPercentTask.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/flexscoring/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/DeleteByPercentTask.java?rev=1143840&r1=1143839&r2=1143840&view=diff
==============================================================================
--- lucene/dev/branches/flexscoring/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/DeleteByPercentTask.java (original)
+++ lucene/dev/branches/flexscoring/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/DeleteByPercentTask.java Thu Jul  7 14:18:02 2011
@@ -74,15 +74,15 @@ public class DeleteByPercentTask extends
     }
     while (numDeleted < numToDelete) {
       double delRate = ((double) (numToDelete-numDeleted))/r.numDocs();
-      Bits delDocs = MultiFields.getDeletedDocs(r);
+      Bits liveDocs = MultiFields.getLiveDocs(r);
       int doc = 0;
       while (doc < maxDoc && numDeleted < numToDelete) {
-        if ((delDocs == null || !delDocs.get(doc)) && random.nextDouble() <= delRate) {
+        if ((liveDocs == null || liveDocs.get(doc)) && random.nextDouble() <= delRate) {
           r.deleteDocument(doc);
           numDeleted++;
-          if (delDocs == null) {
-            delDocs = MultiFields.getDeletedDocs(r);
-            assert delDocs != null;
+          if (liveDocs == null) {
+            liveDocs = MultiFields.getLiveDocs(r);
+            assert liveDocs != null;
           }
         }
         doc++;

Modified: lucene/dev/branches/flexscoring/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/flexscoring/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java?rev=1143840&r1=1143839&r2=1143840&view=diff
==============================================================================
--- lucene/dev/branches/flexscoring/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java (original)
+++ lucene/dev/branches/flexscoring/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java Thu Jul  7 14:18:02 2011
@@ -96,9 +96,9 @@ public abstract class ReadTask extends P
     // optionally warm and add num docs traversed to count
     if (withWarm()) {
       Document doc = null;
-      Bits delDocs = MultiFields.getDeletedDocs(reader);
+      Bits liveDocs = MultiFields.getLiveDocs(reader);
       for (int m = 0; m < reader.maxDoc(); m++) {
-        if (null == delDocs || ! delDocs.get(m)) {
+        if (null == liveDocs || liveDocs.get(m)) {
           doc = reader.document(m);
           res += (doc == null ? 0 : 1);
         }

Modified: lucene/dev/branches/flexscoring/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchWithSortTask.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/flexscoring/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchWithSortTask.java?rev=1143840&r1=1143839&r2=1143840&view=diff
==============================================================================
--- lucene/dev/branches/flexscoring/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchWithSortTask.java (original)
+++ lucene/dev/branches/flexscoring/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchWithSortTask.java Thu Jul  7 14:18:02 2011
@@ -57,7 +57,7 @@ public class SearchWithSortTask extends 
       SortField sortField0;
       if (field.equals("doc")) {
         sortField0 = SortField.FIELD_DOC;
-      } if (field.equals("score")) {
+      } else if (field.equals("score")) {
         sortField0 = SortField.FIELD_SCORE;
       } else if (field.equals("noscore")) {
         doScore = false;
@@ -75,8 +75,7 @@ public class SearchWithSortTask extends 
         } else {
           throw new RuntimeException("You must specify the sort type ie page:int,subject:string");
         }
-        int type = getType(typeString);
-        sortField0 = new SortField(fieldName, type);
+        sortField0 = new SortField(fieldName, SortField.Type.valueOf(typeString.toUpperCase()));
       }
       sortFields[upto++] = sortField0;
     }
@@ -89,30 +88,6 @@ public class SearchWithSortTask extends 
     this.sort = new Sort(sortFields);
   }
 
-  private int getType(String typeString) {
-    int type;
-    if (typeString.equals("float")) {
-      type = SortField.FLOAT;
-    } else if (typeString.equals("double")) {
-      type = SortField.DOUBLE;
-    } else if (typeString.equals("byte")) {
-      type = SortField.BYTE;
-    } else if (typeString.equals("short")) {
-      type = SortField.SHORT;
-    } else if (typeString.equals("int")) {
-      type = SortField.INT;
-    } else if (typeString.equals("long")) {
-      type = SortField.LONG;
-    } else if (typeString.equals("string")) {
-      type = SortField.STRING;
-    } else if (typeString.equals("string_val")) {
-      type = SortField.STRING_VAL;
-    } else {
-      throw new RuntimeException("Unrecognized sort field type " + typeString);
-    }
-    return type;
-  }
-
   @Override
   public boolean supportsParams() {
     return true;

Modified: lucene/dev/branches/flexscoring/modules/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/flexscoring/modules/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java?rev=1143840&r1=1143839&r2=1143840&view=diff
==============================================================================
--- lucene/dev/branches/flexscoring/modules/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java (original)
+++ lucene/dev/branches/flexscoring/modules/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java Thu Jul  7 14:18:02 2011
@@ -481,13 +481,13 @@ public class TestPerfTasksLogic extends 
     FieldsEnum fields = MultiFields.getFields(reader).iterator();
     String fieldName = null;
     while((fieldName = fields.next()) != null) {
-      if (fieldName == DocMaker.ID_FIELD || fieldName == DocMaker.DATE_MSEC_FIELD || fieldName == DocMaker.TIME_SEC_FIELD) {
+      if (fieldName.equals(DocMaker.ID_FIELD) || fieldName.equals(DocMaker.DATE_MSEC_FIELD) || fieldName.equals(DocMaker.TIME_SEC_FIELD)) {
         continue;
       }
       TermsEnum terms = fields.terms();
       DocsEnum docs = null;
       while(terms.next() != null) {
-        docs = terms.docs(MultiFields.getDeletedDocs(reader), docs);
+        docs = terms.docs(MultiFields.getLiveDocs(reader), docs);
         while(docs.nextDoc() != docs.NO_MORE_DOCS) {
           totalTokenCount2 += docs.freq();
         }

Modified: lucene/dev/branches/flexscoring/modules/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/flexscoring/modules/build.xml?rev=1143840&r1=1143839&r2=1143840&view=diff
==============================================================================
--- lucene/dev/branches/flexscoring/modules/build.xml (original)
+++ lucene/dev/branches/flexscoring/modules/build.xml Thu Jul  7 14:18:02 2011
@@ -18,12 +18,16 @@
  -->
 
 <project name="modules" default="test" basedir=".">
+  <!-- TODO: at some point we should probably iterate like contrib-crawl -->
   <target name="test" description="Test all modules">
     <sequential>
       <subant target="test" inheritall="false" failonerror="true">
         <fileset dir="analysis" includes="build.xml" />
         <fileset dir="benchmark" includes="build.xml" />
+        <fileset dir="facet" includes="build.xml" />
         <fileset dir="grouping" includes="build.xml" />
+        <fileset dir="join" includes="build.xml" />
+        <fileset dir="queries" includes="build.xml" />
         <fileset dir="suggest" includes="build.xml" />
       </subant>
     </sequential>
@@ -34,7 +38,10 @@
       <subant target="compile" inheritall="false" failonerror="true">
         <fileset dir="analysis" includes="build.xml" />
         <fileset dir="benchmark" includes="build.xml" />
+        <fileset dir="facet" includes="build.xml" />
         <fileset dir="grouping" includes="build.xml" />
+        <fileset dir="join" includes="build.xml" />
+        <fileset dir="queries" includes="build.xml" />
         <fileset dir="suggest" includes="build.xml" />
       </subant>
     </sequential>
@@ -45,7 +52,10 @@
       <subant target="compile-test" inheritall="false" failonerror="true">
         <fileset dir="analysis" includes="build.xml" />
         <fileset dir="benchmark" includes="build.xml" />
+        <fileset dir="facet" includes="build.xml" />
         <fileset dir="grouping" includes="build.xml" />
+        <fileset dir="join" includes="build.xml" />
+        <fileset dir="queries" includes="build.xml" />
         <fileset dir="suggest" includes="build.xml" />
       </subant>
     </sequential>
@@ -56,7 +66,10 @@
       <subant target="javadocs" inheritall="false" failonerror="true">
         <fileset dir="analysis" includes="build.xml" />
         <fileset dir="benchmark" includes="build.xml" />
+        <fileset dir="facet" includes="build.xml" />
         <fileset dir="grouping" includes="build.xml" />
+        <fileset dir="join" includes="build.xml" />
+        <fileset dir="queries" includes="build.xml" />
         <fileset dir="suggest" includes="build.xml" />
       </subant>
     </sequential>
@@ -68,7 +81,10 @@
       <subant target="dist-maven" inheritall="false" failonerror="true">
         <fileset dir="analysis" includes="build.xml" />
         <fileset dir="benchmark" includes="build.xml" />
+        <fileset dir="facet" includes="build.xml" />
         <fileset dir="grouping" includes="build.xml" />
+        <fileset dir="join" includes="build.xml" />
+        <fileset dir="queries" includes="build.xml" />
         <fileset dir="suggest" includes="build.xml" />
       </subant>
     </sequential>
@@ -78,7 +94,10 @@
       <subant target="validate" inheritall="false" failonerror="true">
         <fileset dir="analysis" includes="build.xml" />
         <fileset dir="benchmark" includes="build.xml" />
+        <fileset dir="facet" includes="build.xml" />
         <fileset dir="grouping" includes="build.xml" />
+        <fileset dir="join" includes="build.xml" />
+        <fileset dir="queries" includes="build.xml" />
         <fileset dir="suggest" includes="build.xml" />
       </subant>
     </sequential>
@@ -90,7 +109,10 @@
       <subant target="clean" inheritall="false" failonerror="true">
         <fileset dir="analysis" includes="build.xml" />
         <fileset dir="benchmark" includes="build.xml" />
+        <fileset dir="facet" includes="build.xml" />
         <fileset dir="grouping" includes="build.xml" />
+        <fileset dir="join" includes="build.xml" />
+        <fileset dir="queries" includes="build.xml" />
         <fileset dir="suggest" includes="build.xml" />
       </subant>
     </sequential>

Modified: lucene/dev/branches/flexscoring/modules/grouping/src/java/org/apache/lucene/search/grouping/AbstractFirstPassGroupingCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/flexscoring/modules/grouping/src/java/org/apache/lucene/search/grouping/AbstractFirstPassGroupingCollector.java?rev=1143840&r1=1143839&r2=1143840&view=diff
==============================================================================
--- lucene/dev/branches/flexscoring/modules/grouping/src/java/org/apache/lucene/search/grouping/AbstractFirstPassGroupingCollector.java (original)
+++ lucene/dev/branches/flexscoring/modules/grouping/src/java/org/apache/lucene/search/grouping/AbstractFirstPassGroupingCollector.java Thu Jul  7 14:18:02 2011
@@ -43,7 +43,8 @@ abstract public class AbstractFirstPassG
   private final int compIDXEnd;
 
   // Set once we reach topNGroups unique groups:
-  private TreeSet<CollectedSearchGroup<GROUP_VALUE_TYPE>> orderedGroups;
+  /** @lucene.internal */
+  protected TreeSet<CollectedSearchGroup<GROUP_VALUE_TYPE>> orderedGroups;
   private int docBase;
   private int spareSlot;
 
@@ -214,8 +215,7 @@ abstract public class AbstractFirstPassG
       // the bottom group with this new group.
 
       // java 6-only: final CollectedSearchGroup bottomGroup = orderedGroups.pollLast();
-      final CollectedSearchGroup<GROUP_VALUE_TYPE> bottomGroup = orderedGroups.last();
-      orderedGroups.remove(bottomGroup);
+      final CollectedSearchGroup<GROUP_VALUE_TYPE> bottomGroup = pollLast();
       assert orderedGroups.size() == topNGroups -1;
 
       groupMap.remove(bottomGroup.groupValue);
@@ -350,9 +350,14 @@ abstract public class AbstractFirstPassG
    * @return a copy of the specified group value
    */
   protected abstract GROUP_VALUE_TYPE copyDocGroupValue(GROUP_VALUE_TYPE groupValue, GROUP_VALUE_TYPE reuse);
-}
 
-class CollectedSearchGroup<T> extends SearchGroup<T> {
-  int topDoc;
-  int comparatorSlot;
+
+
+  protected CollectedSearchGroup<GROUP_VALUE_TYPE> pollLast() {
+    // java 6-only: final CollectedSearchGroup bottomGroup = orderedGroups.pollLast();
+    final CollectedSearchGroup<GROUP_VALUE_TYPE> bottomGroup = orderedGroups.last();
+    orderedGroups.remove(bottomGroup);
+    return bottomGroup;
+  }
 }
+

Modified: lucene/dev/branches/flexscoring/modules/grouping/src/java/org/apache/lucene/search/grouping/SearchGroup.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/flexscoring/modules/grouping/src/java/org/apache/lucene/search/grouping/SearchGroup.java?rev=1143840&r1=1143839&r2=1143840&view=diff
==============================================================================
--- lucene/dev/branches/flexscoring/modules/grouping/src/java/org/apache/lucene/search/grouping/SearchGroup.java (original)
+++ lucene/dev/branches/flexscoring/modules/grouping/src/java/org/apache/lucene/search/grouping/SearchGroup.java Thu Jul  7 14:18:02 2011
@@ -171,7 +171,7 @@ public class SearchGroup<GROUP_VALUE_TYP
   private static class GroupMerger<T> {
 
     private final GroupComparator<T> groupComp;
-    private final SortedSet<MergedGroup<T>> queue;
+    private final NavigableSet<MergedGroup<T>> queue;
     private final Map<T,MergedGroup<T>> groupsSeen;
 
     public GroupMerger(Sort groupSort) throws IOException {
@@ -242,10 +242,8 @@ public class SearchGroup<GROUP_VALUE_TYP
 
       // Prune un-competitive groups:
       while(queue.size() > topN) {
-        // TODO java 1.6: .pollLast
-        final MergedGroup<T> group = queue.last();
+        final MergedGroup<T> group = queue.pollLast();
         //System.out.println("PRUNE: " + group);
-        queue.remove(group);
         group.inQueue = false;
       }
     }
@@ -270,9 +268,7 @@ public class SearchGroup<GROUP_VALUE_TYP
       int count = 0;
 
       while(queue.size() != 0) {
-        // TODO Java 1.6: pollFirst()
-        final MergedGroup<T> group = queue.first();
-        queue.remove(group);
+        final MergedGroup<T> group = queue.pollFirst();
         group.processed = true;
         //System.out.println("  pop: shards=" + group.shards + " group=" + (group.groupValue == null ? "null" : (((BytesRef) group.groupValue).utf8ToString())) + " sortValues=" + Arrays.toString(group.topValues));
         if (count++ >= offset) {



Mime
View raw message