lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From busc...@apache.org
Subject svn commit: r1058718 [18/18] - in /lucene/dev/branches/realtime_search: ./ lucene/ lucene/contrib/ lucene/contrib/ant/src/java/org/apache/lucene/ant/ lucene/contrib/ant/src/test/org/apache/lucene/ant/ lucene/contrib/benchmark/ lucene/contrib/demo/src/j...
Date Thu, 13 Jan 2011 19:53:39 GMT
Modified: lucene/dev/branches/realtime_search/solr/src/test/org/apache/solr/spelling/IndexBasedSpellCheckerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/test/org/apache/solr/spelling/IndexBasedSpellCheckerTest.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/test/org/apache/solr/spelling/IndexBasedSpellCheckerTest.java
(original)
+++ lucene/dev/branches/realtime_search/solr/src/test/org/apache/solr/spelling/IndexBasedSpellCheckerTest.java
Thu Jan 13 19:53:21 2011
@@ -121,7 +121,7 @@ public class IndexBasedSpellCheckerTest 
     try {
     checker.build(core, searcher);
 
-    IndexReader reader = searcher.getReader();
+    IndexReader reader = searcher.getIndexReader();
     Collection<Token> tokens = queryConverter.convert("documemt");
     SpellingOptions spellOpts = new SpellingOptions(tokens, reader);
     SpellingResult result = checker.getSuggestions(spellOpts);
@@ -196,7 +196,7 @@ public class IndexBasedSpellCheckerTest 
     try {
     checker.build(core, searcher);
 
-    IndexReader reader = searcher.getReader();
+    IndexReader reader = searcher.getIndexReader();
     Collection<Token> tokens = queryConverter.convert("documemt");
     SpellingOptions spellOpts = new SpellingOptions(tokens, reader, 1, false, true, 0.5f,
null);
     SpellingResult result = checker.getSuggestions(spellOpts);
@@ -309,7 +309,7 @@ public class IndexBasedSpellCheckerTest 
     try {
     checker.build(core, searcher);
 
-    IndexReader reader = searcher.getReader();
+    IndexReader reader = searcher.getIndexReader();
     Collection<Token> tokens = queryConverter.convert("flesh");
     SpellingOptions spellOpts = new SpellingOptions(tokens, reader, 1, false, true, 0.5f,
null);
     SpellingResult result = checker.getSuggestions(spellOpts);

Modified: lucene/dev/branches/realtime_search/solr/src/test/org/apache/solr/spelling/SpellPossibilityIteratorTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/test/org/apache/solr/spelling/SpellPossibilityIteratorTest.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/test/org/apache/solr/spelling/SpellPossibilityIteratorTest.java
(original)
+++ lucene/dev/branches/realtime_search/solr/src/test/org/apache/solr/spelling/SpellPossibilityIteratorTest.java
Thu Jan 13 19:53:21 2011
@@ -22,16 +22,16 @@ import java.util.Map;
 import org.apache.lucene.analysis.Token;
 import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.spelling.PossibilityIterator;
-import org.junit.BeforeClass;
+import org.junit.Before;
 import org.junit.Test;
 
 public class SpellPossibilityIteratorTest extends SolrTestCaseJ4 {
 
 	private static Map<Token, LinkedHashMap<String, Integer>> suggestions = new
LinkedHashMap<Token, LinkedHashMap<String, Integer>>();
 
-	@BeforeClass
-	public static void beforeClass() throws Exception {
-
+	@Before
+	public void setUp() throws Exception {
+	  super.setUp();
 		suggestions.clear();
 
 		LinkedHashMap<String, Integer> AYE = new LinkedHashMap<String, Integer>();
@@ -72,7 +72,7 @@ public class SpellPossibilityIteratorTes
 		suggestions.put(new Token("BEE", 0, 2), BEE);
 		suggestions.put(new Token("CEE", 0, 2), CEE);
 	}
-
+	
 	@Test
 	public void testSpellPossibilityIterator() throws Exception {
 		PossibilityIterator iter = new PossibilityIterator(suggestions);

Modified: lucene/dev/branches/realtime_search/solr/src/test/org/apache/solr/update/DirectUpdateHandlerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/test/org/apache/solr/update/DirectUpdateHandlerTest.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/test/org/apache/solr/update/DirectUpdateHandlerTest.java
(original)
+++ lucene/dev/branches/realtime_search/solr/src/test/org/apache/solr/update/DirectUpdateHandlerTest.java
Thu Jan 13 19:53:21 2011
@@ -20,18 +20,13 @@ package org.apache.solr.update;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.lucene.document.Document;
-import org.apache.lucene.document.Field;
-import org.apache.lucene.document.Field.Index;
-import org.apache.lucene.document.Field.Store;
+import org.apache.lucene.index.IndexReader;
 import org.apache.solr.SolrTestCaseJ4;
-import org.apache.solr.common.SolrException;
 import org.apache.solr.common.params.CommonParams;
 import org.apache.solr.common.params.MapSolrParams;
 import org.apache.solr.core.SolrCore;
 import org.apache.solr.request.LocalSolrQueryRequest;
 import org.apache.solr.request.SolrQueryRequest;
-import org.apache.solr.search.SolrIndexReader;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -243,18 +238,18 @@ public class DirectUpdateHandlerTest ext
     assertU(commit());
 
     SolrQueryRequest sr = req("q","foo");
-    SolrIndexReader r = sr.getSearcher().getReader();
+    IndexReader r = sr.getSearcher().getTopReaderContext().reader;
     assertTrue(r.maxDoc() > r.numDocs());   // should have deletions
-    assertTrue(r.getLeafReaders().length > 1);  // more than 1 segment
+    assertFalse(r.getTopReaderContext().isAtomic);  // more than 1 segment
     sr.close();
 
     assertU(commit("expungeDeletes","true"));
 
     sr = req("q","foo");
-    r = sr.getSearcher().getReader();
+    r = sr.getSearcher().getTopReaderContext().reader;
     assertEquals(r.maxDoc(), r.numDocs());  // no deletions
     assertEquals(4,r.maxDoc());             // no dups
-    assertTrue(r.getLeafReaders().length > 1);  // still more than 1 segment
+    assertFalse(r.getTopReaderContext().isAtomic);  //still more than 1 segment
     sr.close();
   }
   

Modified: lucene/dev/branches/realtime_search/solr/src/test/org/apache/solr/update/TestIndexingPerformance.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/test/org/apache/solr/update/TestIndexingPerformance.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/test/org/apache/solr/update/TestIndexingPerformance.java
(original)
+++ lucene/dev/branches/realtime_search/solr/src/test/org/apache/solr/update/TestIndexingPerformance.java
Thu Jan 13 19:53:21 2011
@@ -19,6 +19,7 @@ package org.apache.solr.update;
 
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
+import org.apache.lucene.document.Fieldable;
 import org.apache.solr.request.SolrQueryRequest;
 import org.apache.solr.schema.IndexSchema;
 import org.apache.solr.util.AbstractSolrTestCase;
@@ -99,7 +100,7 @@ public class TestIndexingPerformance ext
         for (int j=0; j<fields.length; j+=2) {
           String field = fields[j];
           String val = fields[j+1];
-          Field f = schema.getField(field).createField(val, 1.0f);
+          Fieldable f = schema.getField(field).createField(val, 1.0f);
           add.doc.add(f);
         }
       }

Modified: lucene/dev/branches/realtime_search/solr/src/test/org/apache/solr/update/processor/SignatureUpdateProcessorFactoryTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/test/org/apache/solr/update/processor/SignatureUpdateProcessorFactoryTest.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/test/org/apache/solr/update/processor/SignatureUpdateProcessorFactoryTest.java
(original)
+++ lucene/dev/branches/realtime_search/solr/src/test/org/apache/solr/update/processor/SignatureUpdateProcessorFactoryTest.java
Thu Jan 13 19:53:21 2011
@@ -62,7 +62,7 @@ public class SignatureUpdateProcessorFac
   void checkNumDocs(int n) {
     SolrQueryRequest req = req();
     try {
-      assertEquals(n, req.getSearcher().getReader().numDocs());
+      assertEquals(n, req.getSearcher().getIndexReader().numDocs());
     } finally {
       req.close();
     }

Modified: lucene/dev/branches/realtime_search/solr/src/webapp/src/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/webapp/src/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/webapp/src/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java
(original)
+++ lucene/dev/branches/realtime_search/solr/src/webapp/src/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java
Thu Jan 13 19:53:21 2011
@@ -95,7 +95,7 @@ public final class HttpCacheHeaderUtil {
   public static String calcEtag(final SolrQueryRequest solrReq) {
     final SolrCore core = solrReq.getCore();
     final long currentIndexVersion
-      = solrReq.getSearcher().getReader().getVersion();
+      = solrReq.getSearcher().getIndexReader().getVersion();
 
     EtagCacheVal etagCache = etagCoreCache.get(core);
     if (null == etagCache) {
@@ -152,7 +152,7 @@ public final class HttpCacheHeaderUtil {
       // assume default, change if needed (getOpenTime() should be fast)
       lastMod =
         LastModFrom.DIRLASTMOD == lastModFrom
-        ? IndexReader.lastModified(searcher.getReader().directory())
+        ? IndexReader.lastModified(searcher.getIndexReader().directory())
         : searcher.getOpenTime();
     } catch (IOException e) {
       // we're pretty freaking screwed if this happens



Mime
View raw message