lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r924247 [2/4] - in /lucene/java/branches/flex_1458: ./ backwards/ backwards/src/ contrib/ contrib/analyzers/common/ contrib/analyzers/common/src/java/org/apache/lucene/analysis/hi/ contrib/analyzers/common/src/test/org/apache/lucene/analysi...
Date Wed, 17 Mar 2010 12:06:29 GMT
Modified: lucene/java/branches/flex_1458/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java?rev=924247&r1=924246&r2=924247&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java
(original)
+++ lucene/java/branches/flex_1458/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java
Wed Mar 17 12:06:27 2010
@@ -150,13 +150,15 @@ public class TestCartesian extends Lucen
     LatLng p1 = new FloatLatLng( 7.06, 171.2 );
     LatLng p2 = new FloatLatLng( 21.6032207, -158.0 );
     double miles = p1.arcDistance( p2, DistanceUnits.MILES );
+    if (VERBOSE) {
     System.out.println("testDistances");
     System.out.println("miles:" + miles);
+    }
     assertEquals(2288.82495932794, miles); 
     LatLng p3 = new FloatLatLng( 41.6032207, -73.087749);
     LatLng p4 = new FloatLatLng( 55.0, 4.0 );
     miles = p3.arcDistance( p4, DistanceUnits.MILES );
-    System.out.println("miles:" + miles);
+    if (VERBOSE) System.out.println("miles:" + miles);
     assertEquals(3474.331719997617, miles); 
   }
 
@@ -169,12 +171,12 @@ public class TestCartesian extends Lucen
     lat = 21.6032207;
     lng = -158.0;
 
-    System.out.println("testAntiM");
+    if (VERBOSE) System.out.println("testAntiM");
     // create a distance query
     final DistanceQueryBuilder dq = new DistanceQueryBuilder(lat, lng, miles,
         latField, lngField, CartesianTierPlotter.DEFALT_FIELD_PREFIX, true);
 
-    System.out.println(dq);
+    if (VERBOSE) System.out.println(dq);
     //create a term query to search against all documents
     Query tq = new TermQuery(new Term("metafile", "doc"));
 
@@ -187,7 +189,7 @@ public class TestCartesian extends Lucen
         return new CustomScoreProvider(reader) {
           @Override // TODO: broken, as reader is not used!
           public float customScore(int doc, float subQueryScore, float valSrcScore){
-            System.out.println(doc);
+            if (VERBOSE) System.out.println(doc);
             if (dq.distanceFilter.getDistance(doc) == null)
               return 0;
 
@@ -227,11 +229,13 @@ public class TestCartesian extends Lucen
     // Note Boundary Box filtering, is not accurate enough for most systems.
 
 
+    if (VERBOSE) {
     System.out.println("Distance Filter filtered: " + distances.size());
     System.out.println("Results: " + results);
     System.out.println("=============================");
     System.out.println("Distances should be 2 "+ distances.size());
     System.out.println("Results should be 2 "+ results);
+    }
 
     assertEquals(2, distances.size()); // fixed a store of only needed distances
     assertEquals(2, results);
@@ -246,7 +250,7 @@ public class TestCartesian extends Lucen
 
       double distance = DistanceUtils.getInstance().getDistanceMi(lat, lng, rsLat, rsLng);
       double llm = DistanceUtils.getInstance().getLLMDistance(lat, lng, rsLat, rsLng);
-      System.out.println("Name: "+ name +", Distance "+ distance); //(res, ortho, harvesine):"+
distance +" |"+ geo_distance +"|"+ llm +" | score "+ hits.score(i));
+      if (VERBOSE) System.out.println("Name: "+ name +", Distance "+ distance); //(res, ortho,
harvesine):"+ distance +" |"+ geo_distance +"|"+ llm +" | score "+ hits.score(i));
       assertTrue(Math.abs((distance - llm)) < 1);
       assertTrue((distance < miles ));
       assertTrue(geo_distance >= lastDistance);
@@ -261,13 +265,13 @@ public class TestCartesian extends Lucen
     lat = 41.6032207;
     lng = -73.087749;
 
-    System.out.println("testPoleFlipping");
+    if (VERBOSE) System.out.println("testPoleFlipping");
 
     // create a distance query
     final DistanceQueryBuilder dq = new DistanceQueryBuilder(lat, lng, miles,
         latField, lngField, CartesianTierPlotter.DEFALT_FIELD_PREFIX, true);
 
-    System.out.println(dq);
+    if (VERBOSE) System.out.println(dq);
     //create a term query to search against all documents
     Query tq = new TermQuery(new Term("metafile", "doc"));
 
@@ -280,7 +284,7 @@ public class TestCartesian extends Lucen
         return new CustomScoreProvider(reader) {
           @Override // TODO: broken, as reader is not used!
           public float customScore(int doc, float subQueryScore, float valSrcScore){
-            System.out.println(doc);
+            if (VERBOSE) System.out.println(doc);
             if (dq.distanceFilter.getDistance(doc) == null)
               return 0;
 
@@ -320,11 +324,13 @@ public class TestCartesian extends Lucen
     // Note Boundary Box filtering, is not accurate enough for most systems.
 
 
+    if (VERBOSE) {
     System.out.println("Distance Filter filtered: " + distances.size());
     System.out.println("Results: " + results);
     System.out.println("=============================");
     System.out.println("Distances should be 18 "+ distances.size());
     System.out.println("Results should be 18 "+ results);
+    }
 
     assertEquals(18, distances.size()); // fixed a store of only needed distances
     assertEquals(18, results);
@@ -338,11 +344,11 @@ public class TestCartesian extends Lucen
 
       double distance = DistanceUtils.getInstance().getDistanceMi(lat, lng, rsLat, rsLng);
       double llm = DistanceUtils.getInstance().getLLMDistance(lat, lng, rsLat, rsLng);
-      System.out.println("Name: "+ name +", Distance "+ distance); //(res, ortho, harvesine):"+
distance +" |"+ geo_distance +"|"+ llm +" | score "+ hits.score(i));
+      if (VERBOSE) System.out.println("Name: "+ name +", Distance "+ distance); //(res, ortho,
harvesine):"+ distance +" |"+ geo_distance +"|"+ llm +" | score "+ hits.score(i));
       assertTrue(Math.abs((distance - llm)) < 1);
-      System.out.println("checking limit "+ distance + " < " + miles);
+      if (VERBOSE) System.out.println("checking limit "+ distance + " < " + miles);
       assertTrue((distance < miles ));
-      System.out.println("checking sort "+ geo_distance + " >= " + lastDistance);
+      if (VERBOSE) System.out.println("checking sort "+ geo_distance + " >= " + lastDistance);
       assertTrue(geo_distance >= lastDistance);
       lastDistance = geo_distance;
     }
@@ -362,7 +368,7 @@ public class TestCartesian extends Lucen
       final DistanceQueryBuilder dq = new DistanceQueryBuilder(lat, lng, miles, 
                                                                latField, lngField, CartesianTierPlotter.DEFALT_FIELD_PREFIX,
true);
      
-      System.out.println(dq);
+      if (VERBOSE) System.out.println(dq);
       //create a term query to search against all documents
       Query tq = new TermQuery(new Term("metafile", "doc"));
     
@@ -374,7 +380,7 @@ public class TestCartesian extends Lucen
           return new CustomScoreProvider(reader) {
             @Override // TODO: broken, as reader is not used!
             public float customScore(int doc, float subQueryScore, float valSrcScore){
-              //System.out.println(doc);
+              if (VERBOSE) System.out.println(doc);
               if (dq.distanceFilter.getDistance(doc) == null)
                 return 0;
           
@@ -412,12 +418,13 @@ public class TestCartesian extends Lucen
     
       // Note Boundary Box filtering, is not accurate enough for most systems.
     
-    
+      if (VERBOSE) {
       System.out.println("Distance Filter filtered: " + distances.size());
       System.out.println("Results: " + results);
       System.out.println("=============================");
       System.out.println("Distances should be 7 "+ expected[x] + ":" + distances.size());
       System.out.println("Results should be 7 "+ expected[x] + ":" + results);
+      }
 
       assertEquals(expected[x], distances.size()); // fixed a store of only needed distances
       assertEquals(expected[x], results);
@@ -432,7 +439,7 @@ public class TestCartesian extends Lucen
       
         double distance = DistanceUtils.getInstance().getDistanceMi(lat, lng, rsLat, rsLng);
         double llm = DistanceUtils.getInstance().getLLMDistance(lat, lng, rsLat, rsLng);
-        System.out.println("Name: "+ name +", Distance "+ distance); //(res, ortho, harvesine):"+
distance +" |"+ geo_distance +"|"+ llm +" | score "+ hits.score(i));
+        if (VERBOSE) System.out.println("Name: "+ name +", Distance "+ distance); //(res,
ortho, harvesine):"+ distance +" |"+ geo_distance +"|"+ llm +" | score "+ hits.score(i));
         assertTrue(Math.abs((distance - llm)) < 1);
         assertTrue((distance < miles ));
         assertTrue(geo_distance > lastDistance);
@@ -456,7 +463,7 @@ public class TestCartesian extends Lucen
       final DistanceQueryBuilder dq = new DistanceQueryBuilder(lat, lng, miles, 
                                                                geoHashPrefix, CartesianTierPlotter.DEFALT_FIELD_PREFIX,
true);
 	     
-      System.out.println(dq);
+      if (VERBOSE) System.out.println(dq);
       //create a term query to search against all documents
       Query tq = new TermQuery(new Term("metafile", "doc"));
 	    
@@ -467,7 +474,7 @@ public class TestCartesian extends Lucen
           return new CustomScoreProvider(reader) {
               @Override // TODO: broken, as reader is not used!
               public float customScore(int doc, float subQueryScore, float valSrcScore){
-              //System.out.println(doc);
+              if (VERBOSE) System.out.println(doc);
               if (dq.distanceFilter.getDistance(doc) == null)
                 return 0;
             
@@ -505,12 +512,13 @@ public class TestCartesian extends Lucen
 	    
       // Note Boundary Box filtering, is not accurate enough for most systems.
 	    
-	    
+	    if (VERBOSE) {
       System.out.println("Distance Filter filtered: " + distances.size());
       System.out.println("Results: " + results);
       System.out.println("=============================");
       System.out.println("Distances should be 14 "+ expected[x] + ":" + distances.size());
       System.out.println("Results should be 7 "+ expected[x] + ":" + results);
+      }
 
       assertEquals(expected[x], distances.size());
       assertEquals(expected[x], results);
@@ -525,7 +533,7 @@ public class TestCartesian extends Lucen
 	      
         double distance = DistanceUtils.getInstance().getDistanceMi(lat, lng, rsLat, rsLng);
         double llm = DistanceUtils.getInstance().getLLMDistance(lat, lng, rsLat, rsLng);
-        System.out.println("Name: "+ name +", Distance (res, ortho, harvesine):"+ distance
+" |"+ geo_distance +"|"+ llm +" | score "+ scoreDocs[i].score);
+        if (VERBOSE) System.out.println("Name: "+ name +", Distance (res, ortho, harvesine):"+
distance +" |"+ geo_distance +"|"+ llm +" | score "+ scoreDocs[i].score);
         assertTrue(Math.abs((distance - llm)) < 1);
         assertTrue((distance < miles ));
 	      

Modified: lucene/java/branches/flex_1458/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestDistance.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestDistance.java?rev=924247&r1=924246&r2=924247&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestDistance.java
(original)
+++ lucene/java/branches/flex_1458/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestDistance.java
Wed Mar 17 12:06:27 2010
@@ -105,7 +105,7 @@ public class TestDistance extends Lucene
     }
   }
  
-  
+  /* these tests do not test anything, as no assertions:
   public void testMiles() {
     double LLM = DistanceUtils.getInstance().getLLMDistance(lat, lng,39.012200001, -77.3942);
     System.out.println(LLM);
@@ -119,7 +119,7 @@ public class TestDistance extends Lucene
     System.out.println("-->"+DistanceUtils.getInstance().getDistanceMi(44.30073, -78.32131,
43.687267, -79.39842));
     
   }
-
+  */
   
 //  public void testDistanceQueryCacheable() throws IOException {
 //

Modified: lucene/java/branches/flex_1458/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndPrefixQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndPrefixQuery.java?rev=924247&r1=924246&r2=924247&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndPrefixQuery.java
(original)
+++ lucene/java/branches/flex_1458/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndPrefixQuery.java
Wed Mar 17 12:06:27 2010
@@ -59,7 +59,6 @@ public class SrndPrefixQuery extends Sim
   {
     /* inspired by PrefixQuery.rewrite(): */
     Terms terms = MultiFields.getTerms(reader, fieldName);
-    boolean expanded = false;
     if (terms != null) {
       TermsEnum termsEnum = terms.iterator();
 
@@ -67,11 +66,9 @@ public class SrndPrefixQuery extends Sim
       TermsEnum.SeekStatus status = termsEnum.seek(new BytesRef(getPrefix()));
       if (status == TermsEnum.SeekStatus.FOUND) {
         mtv.visitMatchingTerm(getLucenePrefixTerm(fieldName));
-        expanded = true;
       } else if (status == TermsEnum.SeekStatus.NOT_FOUND) {
         if (termsEnum.term().startsWith(prefixRef)) {
           mtv.visitMatchingTerm(new Term(fieldName, termsEnum.term().utf8ToString()));
-          expanded = true;
         } else {
           skip = true;
         }
@@ -85,16 +82,11 @@ public class SrndPrefixQuery extends Sim
           BytesRef text = termsEnum.next();
           if (text != null && text.startsWith(prefixRef)) {
             mtv.visitMatchingTerm(new Term(fieldName, text.utf8ToString()));
-            expanded = true;
           } else {
             break;
           }
         }
       }
     }
-
-    if (! expanded) {
-      System.out.println("No terms in " + fieldName + " field for: " + toString());
-    }
   }
 }

Modified: lucene/java/branches/flex_1458/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndTermQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndTermQuery.java?rev=924247&r1=924246&r2=924247&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndTermQuery.java
(original)
+++ lucene/java/branches/flex_1458/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndTermQuery.java
Wed Mar 17 12:06:27 2010
@@ -56,8 +56,6 @@ public class SrndTermQuery extends Simpl
       TermsEnum.SeekStatus status = termsEnum.seek(new BytesRef(getTermText()));
       if (status == TermsEnum.SeekStatus.FOUND) {
         mtv.visitMatchingTerm(getLuceneTerm(fieldName));
-      } else {
-        System.out.println("No term in " + fieldName + " field for: " + toString());
       }
     }
   }

Modified: lucene/java/branches/flex_1458/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndTruncQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndTruncQuery.java?rev=924247&r1=924246&r2=924247&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndTruncQuery.java
(original)
+++ lucene/java/branches/flex_1458/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndTruncQuery.java
Wed Mar 17 12:06:27 2010
@@ -88,7 +88,6 @@ public class SrndTruncQuery extends Simp
     String fieldName,
     MatchingTermVisitor mtv) throws IOException
   {
-    boolean expanded = false;
     int prefixLength = prefix.length();
     Terms terms = MultiFields.getTerms(reader, fieldName);
     if (terms != null) {
@@ -112,7 +111,6 @@ public class SrndTruncQuery extends Simp
             matcher.reset(textString.substring(prefixLength));
             if (matcher.matches()) {
               mtv.visitMatchingTerm(new Term(fieldName, textString));
-              expanded = true;
             }
           } else {
             break;
@@ -123,9 +121,5 @@ public class SrndTruncQuery extends Simp
         matcher.reset();
       }
     }
-      
-    if (! expanded) {
-      System.out.println("No terms in " + fieldName + " field for: " + toString());
-    }
   }
 }

Modified: lucene/java/branches/flex_1458/contrib/wordnet/src/test/org/apache/lucene/wordnet/TestSynonymTokenFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/wordnet/src/test/org/apache/lucene/wordnet/TestSynonymTokenFilter.java?rev=924247&r1=924246&r2=924247&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/wordnet/src/test/org/apache/lucene/wordnet/TestSynonymTokenFilter.java
(original)
+++ lucene/java/branches/flex_1458/contrib/wordnet/src/test/org/apache/lucene/wordnet/TestSynonymTokenFilter.java
Wed Mar 17 12:06:27 2010
@@ -30,11 +30,10 @@ import org.apache.lucene.analysis.Whites
 import org.apache.lucene.analysis.BaseTokenStreamTestCase;
 
 public class TestSynonymTokenFilter extends BaseTokenStreamTestCase {
-  File dataDir = new File(System.getProperty("dataDir", "./bin"));
-  File testFile = new File(dataDir, "org/apache/lucene/wordnet/testSynonyms.txt");
+  final String testFile = "testSynonyms.txt";
   
   public void testSynonyms() throws Exception {
-    SynonymMap map = new SynonymMap(new FileInputStream(testFile));
+    SynonymMap map = new SynonymMap(getClass().getResourceAsStream(testFile));
     /* all expansions */
     Analyzer analyzer = new SynonymWhitespaceAnalyzer(map, Integer.MAX_VALUE);
     assertAnalyzesTo(analyzer, "Lost in the woods",
@@ -45,7 +44,7 @@ public class TestSynonymTokenFilter exte
   }
   
   public void testSynonymsSingleQuote() throws Exception {
-    SynonymMap map = new SynonymMap(new FileInputStream(testFile));
+    SynonymMap map = new SynonymMap(getClass().getResourceAsStream(testFile));
     /* all expansions */
     Analyzer analyzer = new SynonymWhitespaceAnalyzer(map, Integer.MAX_VALUE);
     assertAnalyzesTo(analyzer, "king",
@@ -53,7 +52,7 @@ public class TestSynonymTokenFilter exte
   }
   
   public void testSynonymsLimitedAmount() throws Exception {
-    SynonymMap map = new SynonymMap(new FileInputStream(testFile));
+    SynonymMap map = new SynonymMap(getClass().getResourceAsStream(testFile));
     /* limit to one synonym expansion */
     Analyzer analyzer = new SynonymWhitespaceAnalyzer(map, 1);
     assertAnalyzesTo(analyzer, "Lost in the woods",
@@ -67,7 +66,7 @@ public class TestSynonymTokenFilter exte
   }
   
   public void testReusableTokenStream() throws Exception {
-    SynonymMap map = new SynonymMap(new FileInputStream(testFile));
+    SynonymMap map = new SynonymMap(getClass().getResourceAsStream(testFile));
     /* limit to one synonym expansion */
     Analyzer analyzer = new SynonymWhitespaceAnalyzer(map, 1);
     assertAnalyzesToReuse(analyzer, "Lost in the woods",

Modified: lucene/java/branches/flex_1458/contrib/wordnet/src/test/org/apache/lucene/wordnet/TestWordnet.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/wordnet/src/test/org/apache/lucene/wordnet/TestWordnet.java?rev=924247&r1=924246&r2=924247&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/wordnet/src/test/org/apache/lucene/wordnet/TestWordnet.java
(original)
+++ lucene/java/branches/flex_1458/contrib/wordnet/src/test/org/apache/lucene/wordnet/TestWordnet.java
Wed Mar 17 12:06:27 2010
@@ -34,16 +34,14 @@ import org.apache.lucene.util.LuceneTest
 public class TestWordnet extends LuceneTestCase {
   private Searcher searcher;
   
-  File dataDir = new File(System.getProperty("dataDir", "./bin"));
-  File testFile = new File(dataDir, "org/apache/lucene/wordnet/testSynonyms.txt");
-  
   String storePathName = 
-    new File(System.getProperty("tempDir"),"testLuceneWordnet").getAbsolutePath();
+    new File(TEMP_DIR,"testLuceneWordnet").getAbsolutePath();
   
   @Override
   protected void setUp() throws Exception {
     super.setUp();
     // create a temporary synonym index
+    File testFile = getDataFile("testSynonyms.txt");
     String commandLineArgs[] = { testFile.getAbsolutePath(), storePathName };
     
     try {

Modified: lucene/java/branches/flex_1458/contrib/xml-query-parser/src/test/org/apache/lucene/xmlparser/TestParser.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/xml-query-parser/src/test/org/apache/lucene/xmlparser/TestParser.java?rev=924247&r1=924246&r2=924247&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/xml-query-parser/src/test/org/apache/lucene/xmlparser/TestParser.java
(original)
+++ lucene/java/branches/flex_1458/contrib/xml-query-parser/src/test/org/apache/lucene/xmlparser/TestParser.java
Wed Mar 17 12:06:27 2010
@@ -5,8 +5,6 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 
-import junit.framework.TestCase;
-
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
 import org.apache.lucene.document.Field;
@@ -18,6 +16,7 @@ import org.apache.lucene.search.ScoreDoc
 import org.apache.lucene.search.TopDocs;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.RAMDirectory;
+import org.apache.lucene.util.LuceneTestCase;
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -35,7 +34,7 @@ import org.apache.lucene.store.RAMDirect
  * limitations under the License.
  */
 
-public class TestParser extends TestCase {
+public class TestParser extends LuceneTestCase {
 
 	CoreParser builder;
 	static Directory dir;
@@ -43,11 +42,7 @@ public class TestParser extends TestCase
 	Analyzer analyzer=new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_24); 
 	IndexReader reader;
 	private IndexSearcher searcher;
-	
-	//CHANGE THIS TO SEE OUTPUT
-	boolean printResults=false;
-	
-	
+
 	/*
 	 * @see TestCase#setUp()
 	 */
@@ -141,7 +136,7 @@ public class TestParser extends TestCase
 	{
 			Query q=parse("FuzzyLikeThisQuery.xml");
 			//show rewritten fuzzyLikeThisQuery - see what is being matched on
-			if(printResults)
+			if(VERBOSE)
 			{
 				System.out.println(q.rewrite(reader));
 			}
@@ -208,7 +203,7 @@ public class TestParser extends TestCase
 	{
 		TopDocs hits = searcher.search(q, null, numDocs);
 		assertTrue(qType +" should produce results ", hits.totalHits>0);
-		if(printResults)
+		if(VERBOSE)
 		{
 			System.out.println("========="+qType+"============");
 			ScoreDoc[] scoreDocs = hits.scoreDocs;

Modified: lucene/java/branches/flex_1458/docs/fileformats.html
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/docs/fileformats.html?rev=924247&r1=924246&r2=924247&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/docs/fileformats.html (original)
+++ lucene/java/branches/flex_1458/docs/fileformats.html Wed Mar 17 12:06:27 2010
@@ -419,10 +419,32 @@ document.write("Last Published: " + docu
 		compatible (in the same way as the lock-less commits
 		change in 2.1).
             </p>
+<p>
+	        In version 2.4, Strings are now written as true UTF-8
+	        byte sequence, not Java's modified UTF-8.  See issue
+	        LUCENE-510 for details.
+            </p>
+<p>
+	        In version 2.9, an optional opaque Map&lt;String,String&gt;
+	        CommitUserData may be passed to IndexWriter's commit
+	        methods (and later retrieved), which is recorded in
+	        the segments_N file.  See issue LUCENE-1382 for
+	        details.  Also, diagnostics were added to each segment
+	        written recording details about why it was written
+	        (due to flush, merge; which OS/JRE was used; etc.).
+	        See issue LUCENE-1654 for details.
+            </p>
+<p>
+	        In version 3.0, compressed fields are no longer
+	        written to the index (they can still be read, but on
+	        merge the new segment will write them,
+	        uncompressed). See issue LUCENE-1960 for details.
+
+            </p>
 </div>
 
         
-<a name="N1002B"></a><a name="Definitions"></a>
+<a name="N10034"></a><a name="Definitions"></a>
 <h2 class="boxed">Definitions</h2>
 <div class="section">
 <p>
@@ -463,7 +485,7 @@ document.write("Last Published: " + docu
                 strings, the first naming the field, and the second naming text
                 within the field.
             </p>
-<a name="N1004B"></a><a name="Inverted Indexing"></a>
+<a name="N10054"></a><a name="Inverted Indexing"></a>
 <h3 class="boxed">Inverted Indexing</h3>
 <p>
                     The index stores statistics about terms in order
@@ -473,7 +495,7 @@ document.write("Last Published: " + docu
                     it.  This is the inverse of the natural relationship, in which
                     documents list terms.
                 </p>
-<a name="N10057"></a><a name="Types of Fields"></a>
+<a name="N10060"></a><a name="Types of Fields"></a>
 <h3 class="boxed">Types of Fields</h3>
 <p>
                     In Lucene, fields may be <i>stored</i>, in which
@@ -487,7 +509,7 @@ document.write("Last Published: " + docu
                     to be indexed literally.
                 </p>
 <p>See the <a href="api/core/org/apache/lucene/document/Field.html">Field</a>
java docs for more information on Fields.</p>
-<a name="N10074"></a><a name="Segments"></a>
+<a name="N1007D"></a><a name="Segments"></a>
 <h3 class="boxed">Segments</h3>
 <p>
                     Lucene indexes may be composed of multiple sub-indexes, or
@@ -513,7 +535,7 @@ document.write("Last Published: " + docu
                     Searches may involve multiple segments and/or multiple indexes, each
                     index potentially composed of a set of segments.
                 </p>
-<a name="N10092"></a><a name="Document Numbers"></a>
+<a name="N1009B"></a><a name="Document Numbers"></a>
 <h3 class="boxed">Document Numbers</h3>
 <p>
                     Internally, Lucene refers to documents by an integer <i>document
@@ -568,7 +590,7 @@ document.write("Last Published: " + docu
 </div>
 
         
-<a name="N100B9"></a><a name="Overview"></a>
+<a name="N100C2"></a><a name="Overview"></a>
 <h2 class="boxed">Overview</h2>
 <div class="section">
 <p>
@@ -667,7 +689,7 @@ document.write("Last Published: " + docu
 </div>
 
         
-<a name="N100FC"></a><a name="File Naming"></a>
+<a name="N10105"></a><a name="File Naming"></a>
 <h2 class="boxed">File Naming</h2>
 <div class="section">
 <p>
@@ -694,7 +716,7 @@ document.write("Last Published: " + docu
             </p>
 </div>
       
-<a name="N1010B"></a><a name="file-names"></a>
+<a name="N10114"></a><a name="file-names"></a>
 <h2 class="boxed">Summary of File Extensions</h2>
 <div class="section">
 <p>The following table summarizes the names and extensions of the files in Lucene:
@@ -836,10 +858,10 @@ document.write("Last Published: " + docu
 </div>
 
         
-<a name="N101F5"></a><a name="Primitive Types"></a>
+<a name="N101FE"></a><a name="Primitive Types"></a>
 <h2 class="boxed">Primitive Types</h2>
 <div class="section">
-<a name="N101FA"></a><a name="Byte"></a>
+<a name="N10203"></a><a name="Byte"></a>
 <h3 class="boxed">Byte</h3>
 <p>
                     The most primitive type
@@ -847,7 +869,7 @@ document.write("Last Published: " + docu
                     other data types are defined as sequences
                     of bytes, so file formats are byte-order independent.
                 </p>
-<a name="N10203"></a><a name="UInt32"></a>
+<a name="N1020C"></a><a name="UInt32"></a>
 <h3 class="boxed">UInt32</h3>
 <p>
                     32-bit unsigned integers are written as four
@@ -857,7 +879,7 @@ document.write("Last Published: " + docu
                     UInt32    --&gt; &lt;Byte&gt;<sup>4</sup>
                 
 </p>
-<a name="N10212"></a><a name="Uint64"></a>
+<a name="N1021B"></a><a name="Uint64"></a>
 <h3 class="boxed">Uint64</h3>
 <p>
                     64-bit unsigned integers are written as eight
@@ -866,7 +888,7 @@ document.write("Last Published: " + docu
 <p>UInt64    --&gt; &lt;Byte&gt;<sup>8</sup>
                 
 </p>
-<a name="N10221"></a><a name="VInt"></a>
+<a name="N1022A"></a><a name="VInt"></a>
 <h3 class="boxed">VInt</h3>
 <p>
                     A variable-length format for positive integers is
@@ -1416,13 +1438,13 @@ document.write("Last Published: " + docu
                     This provides compression while still being
                     efficient to decode.
                 </p>
-<a name="N10506"></a><a name="Chars"></a>
+<a name="N1050F"></a><a name="Chars"></a>
 <h3 class="boxed">Chars</h3>
 <p>
                     Lucene writes unicode
                     character sequences as UTF-8 encoded bytes.
                 </p>
-<a name="N1050F"></a><a name="String"></a>
+<a name="N10518"></a><a name="String"></a>
 <h3 class="boxed">String</h3>
 <p>
 		    Lucene writes strings as UTF-8 encoded bytes.
@@ -1435,10 +1457,10 @@ document.write("Last Published: " + docu
 </div>
 
         
-<a name="N1051C"></a><a name="Compound Types"></a>
+<a name="N10525"></a><a name="Compound Types"></a>
 <h2 class="boxed">Compound Types</h2>
 <div class="section">
-<a name="N10521"></a><a name="MapStringString"></a>
+<a name="N1052A"></a><a name="MapStringString"></a>
 <h3 class="boxed">Map&lt;String,String&gt;</h3>
 <p>
 		    In a couple places Lucene stores a Map
@@ -1451,13 +1473,13 @@ document.write("Last Published: " + docu
 </div>
 
         
-<a name="N10531"></a><a name="Per-Index Files"></a>
+<a name="N1053A"></a><a name="Per-Index Files"></a>
 <h2 class="boxed">Per-Index Files</h2>
 <div class="section">
 <p>
                 The files in this section exist one-per-index.
             </p>
-<a name="N10539"></a><a name="Segments File"></a>
+<a name="N10542"></a><a name="Segments File"></a>
 <h3 class="boxed">Segments File</h3>
 <p>
                     The active segments in the index are stored in the
@@ -1624,7 +1646,7 @@ document.write("Last Published: " + docu
 		    Lucene version, OS, Java version, why the segment
 		    was created (merge, flush, addIndexes), etc.
                 </p>
-<a name="N105BE"></a><a name="Lock File"></a>
+<a name="N105C7"></a><a name="Lock File"></a>
 <h3 class="boxed">Lock File</h3>
 <p>
                     The write lock, which is stored in the index
@@ -1638,14 +1660,14 @@ document.write("Last Published: " + docu
                     documents).  This lock file ensures that only one
                     writer is modifying the index at a time.
                 </p>
-<a name="N105C7"></a><a name="Deletable File"></a>
+<a name="N105D0"></a><a name="Deletable File"></a>
 <h3 class="boxed">Deletable File</h3>
 <p>
                     A writer dynamically computes
                     the files that are deletable, instead, so no file
                     is written.
                 </p>
-<a name="N105D0"></a><a name="Compound Files"></a>
+<a name="N105D9"></a><a name="Compound Files"></a>
 <h3 class="boxed">Compound Files</h3>
 <p>Starting with Lucene 1.4 the compound file format became default. This
                     is simply a container for all files described in the next section
@@ -1672,14 +1694,14 @@ document.write("Last Published: " + docu
 </div>
 
         
-<a name="N105F8"></a><a name="Per-Segment Files"></a>
+<a name="N10601"></a><a name="Per-Segment Files"></a>
 <h2 class="boxed">Per-Segment Files</h2>
 <div class="section">
 <p>
                 The remaining files are all per-segment, and are
                 thus defined by suffix.
             </p>
-<a name="N10600"></a><a name="Fields"></a>
+<a name="N10609"></a><a name="Fields"></a>
 <h3 class="boxed">Fields</h3>
 <p>
                     
@@ -1873,7 +1895,7 @@ document.write("Last Published: " + docu
 </li>
                 
 </ol>
-<a name="N106A7"></a><a name="Term Dictionary"></a>
+<a name="N106B0"></a><a name="Term Dictionary"></a>
 <h3 class="boxed">Term Dictionary</h3>
 <p>
                     The term dictionary is represented as two files:
@@ -2065,7 +2087,7 @@ document.write("Last Published: " + docu
 </li>
                 
 </ol>
-<a name="N1072B"></a><a name="Frequencies"></a>
+<a name="N10734"></a><a name="Frequencies"></a>
 <h3 class="boxed">Frequencies</h3>
 <p>
                     The .frq file contains the lists of documents
@@ -2193,7 +2215,7 @@ document.write("Last Published: " + docu
                    entry in level-1. In the example has entry 15 on level 1 a pointer to
entry 15 on level 0 and entry 31 on level 1 a pointer
                    to entry 31 on level 0.                   
                 </p>
-<a name="N107B3"></a><a name="Positions"></a>
+<a name="N107BC"></a><a name="Positions"></a>
 <h3 class="boxed">Positions</h3>
 <p>
                     The .prx file contains the lists of positions that
@@ -2263,7 +2285,7 @@ document.write("Last Published: " + docu
                     Payload. If PayloadLength is not stored, then this Payload has the same
                     length as the Payload at the previous position.
                 </p>
-<a name="N107EF"></a><a name="Normalization Factors"></a>
+<a name="N107F8"></a><a name="Normalization Factors"></a>
 <h3 class="boxed">Normalization Factors</h3>
 <p>There's a single .nrm file containing all norms:
                 </p>
@@ -2343,7 +2365,7 @@ document.write("Last Published: " + docu
                 </p>
 <p>Separate norm files are created (when adequate) for both compound and non compound
segments.
                 </p>
-<a name="N10840"></a><a name="Term Vectors"></a>
+<a name="N10849"></a><a name="Term Vectors"></a>
 <h3 class="boxed">Term Vectors</h3>
 <p>
 		  Term Vector support is an optional on a field by
@@ -2479,7 +2501,7 @@ document.write("Last Published: " + docu
 </li>
                 
 </ol>
-<a name="N108DC"></a><a name="Deleted Documents"></a>
+<a name="N108E5"></a><a name="Deleted Documents"></a>
 <h3 class="boxed">Deleted Documents</h3>
 <p>The .del file is
                     optional, and only exists when a segment contains deletions.
@@ -2543,7 +2565,7 @@ document.write("Last Published: " + docu
 </div>
 
         
-<a name="N10916"></a><a name="Limitations"></a>
+<a name="N1091F"></a><a name="Limitations"></a>
 <h2 class="boxed">Limitations</h2>
 <div class="section">
 <p>



Mime
View raw message