lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1468217 - in /lucene/dev/branches/branch_4x: ./ lucene/ lucene/analysis/ lucene/analysis/common/src/test/org/apache/lucene/analysis/core/ lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/ lucene/analysis/uima/src/test/org...
Date Mon, 15 Apr 2013 20:38:07 GMT
Author: rmuir
Date: Mon Apr 15 20:38:06 2013
New Revision: 1468217

URL: http://svn.apache.org/r1468217
Log:
more new IndexSearcher -> newSearcher in tests

Modified:
    lucene/dev/branches/branch_4x/   (props changed)
    lucene/dev/branches/branch_4x/lucene/   (props changed)
    lucene/dev/branches/branch_4x/lucene/analysis/   (props changed)
    lucene/dev/branches/branch_4x/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestKeywordAnalyzer.java
    lucene/dev/branches/branch_4x/lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/ShingleAnalyzerWrapperTest.java
    lucene/dev/branches/branch_4x/lucene/analysis/uima/src/test/org/apache/lucene/analysis/uima/UIMABaseAnalyzerTest.java
    lucene/dev/branches/branch_4x/lucene/benchmark/   (props changed)
    lucene/dev/branches/branch_4x/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/DocMakerTest.java
    lucene/dev/branches/branch_4x/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/LineDocSourceTest.java
    lucene/dev/branches/branch_4x/lucene/core/   (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/search/TestConstantScoreQuery.java
    lucene/dev/branches/branch_4x/lucene/facet/   (props changed)
    lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/sampling/OversampleWithDepthTest.java
    lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/CountingFacetsAggregatorTest.java
    lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestDrillSideways.java
    lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestFacetsCollector.java
    lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestStandardFacetsAccumulator.java
    lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/util/TestFacetsPayloadMigrationReader.java
    lucene/dev/branches/branch_4x/lucene/grouping/   (props changed)
    lucene/dev/branches/branch_4x/lucene/grouping/src/test/org/apache/lucene/search/grouping/AllGroupHeadsCollectorTest.java
    lucene/dev/branches/branch_4x/lucene/grouping/src/test/org/apache/lucene/search/grouping/AllGroupsCollectorTest.java
    lucene/dev/branches/branch_4x/lucene/grouping/src/test/org/apache/lucene/search/grouping/GroupFacetCollectorTest.java
    lucene/dev/branches/branch_4x/lucene/grouping/src/test/org/apache/lucene/search/grouping/GroupingSearchTest.java
    lucene/dev/branches/branch_4x/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java
    lucene/dev/branches/branch_4x/lucene/highlighter/   (props changed)
    lucene/dev/branches/branch_4x/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
    lucene/dev/branches/branch_4x/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/FastVectorHighlighterTest.java
    lucene/dev/branches/branch_4x/lucene/memory/   (props changed)
    lucene/dev/branches/branch_4x/lucene/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java
    lucene/dev/branches/branch_4x/lucene/misc/   (props changed)
    lucene/dev/branches/branch_4x/lucene/misc/src/test/org/apache/lucene/document/TestLazyDocument.java
    lucene/dev/branches/branch_4x/lucene/queries/   (props changed)
    lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/CommonTermsQueryTest.java
    lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/TermsFilterTest.java
    lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/TestCustomScoreQuery.java
    lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/function/TestFieldScoreQuery.java
    lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/function/TestOrdValues.java
    lucene/dev/branches/branch_4x/lucene/queryparser/   (props changed)
    lucene/dev/branches/branch_4x/lucene/queryparser/src/java/org/apache/lucene/queryparser/complexPhrase/ComplexPhraseQueryParser.java
    lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/analyzing/TestAnalyzingQueryParser.java
    lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiFieldQueryParser.java
    lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java
    lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestMultiFieldQPHelper.java
    lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestQueryTemplateManager.java
    lucene/dev/branches/branch_4x/lucene/sandbox/   (props changed)
    lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/regex/TestSpanRegexQuery.java

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestKeywordAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestKeywordAnalyzer.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestKeywordAnalyzer.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestKeywordAnalyzer.java Mon Apr 15 20:38:06 2013
@@ -60,7 +60,7 @@ public class TestKeywordAnalyzer extends
     writer.close();
 
     reader = DirectoryReader.open(directory);
-    searcher = new IndexSearcher(reader);
+    searcher = newSearcher(reader);
   }
   
   @Override

Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/ShingleAnalyzerWrapperTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/ShingleAnalyzerWrapperTest.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/ShingleAnalyzerWrapperTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/test/org/apache/lucene/analysis/shingle/ShingleAnalyzerWrapperTest.java Mon Apr 15 20:38:06 2013
@@ -74,7 +74,7 @@ public class ShingleAnalyzerWrapperTest 
     writer.close();
 
     reader = DirectoryReader.open(directory);
-    searcher = new IndexSearcher(reader);
+    searcher = newSearcher(reader);
   }
   
   @Override

Modified: lucene/dev/branches/branch_4x/lucene/analysis/uima/src/test/org/apache/lucene/analysis/uima/UIMABaseAnalyzerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/uima/src/test/org/apache/lucene/analysis/uima/UIMABaseAnalyzerTest.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/uima/src/test/org/apache/lucene/analysis/uima/UIMABaseAnalyzerTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/uima/src/test/org/apache/lucene/analysis/uima/UIMABaseAnalyzerTest.java Mon Apr 15 20:38:06 2013
@@ -81,7 +81,7 @@ public class UIMABaseAnalyzerTest extend
 
     // try the search over the first doc
     DirectoryReader directoryReader = DirectoryReader.open(dir);
-    IndexSearcher indexSearcher = new IndexSearcher(directoryReader);
+    IndexSearcher indexSearcher = newSearcher(directoryReader);
     TopDocs result = indexSearcher.search(new MatchAllDocsQuery(), 1);
     assertTrue(result.totalHits > 0);
     Document d = indexSearcher.doc(result.scoreDocs[0].doc);
@@ -102,7 +102,7 @@ public class UIMABaseAnalyzerTest extend
 
     directoryReader.close();
     directoryReader = DirectoryReader.open(dir);
-    indexSearcher = new IndexSearcher(directoryReader);
+    indexSearcher = newSearcher(directoryReader);
     result = indexSearcher.search(new MatchAllDocsQuery(), 2);
     Document d1 = indexSearcher.doc(result.scoreDocs[1].doc);
     assertNotNull(d1);
@@ -112,7 +112,7 @@ public class UIMABaseAnalyzerTest extend
     assertEquals(dogmasContents, d1.getField("contents").stringValue());
 
     // do a matchalldocs query to retrieve both docs
-    indexSearcher = new IndexSearcher(directoryReader);
+    indexSearcher = newSearcher(directoryReader);
     result = indexSearcher.search(new MatchAllDocsQuery(), 2);
     assertEquals(2, result.totalHits);
     writer.close();

Modified: lucene/dev/branches/branch_4x/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/DocMakerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/DocMakerTest.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/DocMakerTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/DocMakerTest.java Mon Apr 15 20:38:06 2013
@@ -90,7 +90,7 @@ public class DocMakerTest extends Benchm
     tasks.doLogic();
     
     IndexReader reader = DirectoryReader.open(runData.getDirectory());
-    IndexSearcher searcher = new IndexSearcher(reader);
+    IndexSearcher searcher = newSearcher(reader);
     TopDocs td = searcher.search(new TermQuery(new Term("key", "value")), 10);
     assertEquals(numExpectedResults, td.totalHits);
     reader.close();

Modified: lucene/dev/branches/branch_4x/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/LineDocSourceTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/LineDocSourceTest.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/LineDocSourceTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/LineDocSourceTest.java Mon Apr 15 20:38:06 2013
@@ -151,7 +151,7 @@ public class LineDocSourceTest extends B
       }
       
       reader = DirectoryReader.open(runData.getDirectory());
-      searcher = new IndexSearcher(reader);
+      searcher = newSearcher(reader);
       TopDocs td = searcher.search(new TermQuery(new Term("body", "body")), 10);
       assertEquals(numAdds, td.totalHits);
       assertNotNull(td.scoreDocs[0]);

Modified: lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/search/TestConstantScoreQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/search/TestConstantScoreQuery.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/search/TestConstantScoreQuery.java (original)
+++ lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/search/TestConstantScoreQuery.java Mon Apr 15 20:38:06 2013
@@ -95,7 +95,7 @@ public class TestConstantScoreQuery exte
 
       reader = writer.getReader();
       writer.close();
-      searcher = new IndexSearcher(reader);
+      searcher = newSearcher(reader);
       
       // set a similarity that does not normalize our boost away
       searcher.setSimilarity(new DefaultSimilarity() {

Modified: lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/sampling/OversampleWithDepthTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/sampling/OversampleWithDepthTest.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/sampling/OversampleWithDepthTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/sampling/OversampleWithDepthTest.java Mon Apr 15 20:38:06 2013
@@ -119,7 +119,7 @@ public class OversampleWithDepthTest ext
     StandardFacetsAccumulator sfa = new SamplingAccumulator(sampler, fsp, r, tr);
     FacetsCollector fcWithSampling = FacetsCollector.create(sfa);
     
-    IndexSearcher s = new IndexSearcher(r);
+    IndexSearcher s = newSearcher(r);
     s.search(new MatchAllDocsQuery(), fcWithSampling);
     
     // there's only one expected result, return just it.

Modified: lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/CountingFacetsAggregatorTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/CountingFacetsAggregatorTest.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/CountingFacetsAggregatorTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/CountingFacetsAggregatorTest.java Mon Apr 15 20:38:06 2013
@@ -292,7 +292,7 @@ public class CountingFacetsAggregatorTes
     // test the collector w/ FacetRequests and different numResults
     DirectoryReader indexReader = DirectoryReader.open(indexDir);
     TaxonomyReader taxoReader = new DirectoryTaxonomyReader(taxoDir);
-    IndexSearcher searcher = new IndexSearcher(indexReader);
+    IndexSearcher searcher = newSearcher(indexReader);
     
     FacetSearchParams fsp = new FacetSearchParams(new CountFacetRequest(CP_A, NUM_CHILDREN_CP_A), 
         new CountFacetRequest(CP_B, NUM_CHILDREN_CP_B));
@@ -317,7 +317,7 @@ public class CountingFacetsAggregatorTes
   public void testAllCounts() throws Exception {
     DirectoryReader indexReader = DirectoryReader.open(indexDir);
     TaxonomyReader taxoReader = new DirectoryTaxonomyReader(taxoDir);
-    IndexSearcher searcher = new IndexSearcher(indexReader);
+    IndexSearcher searcher = newSearcher(indexReader);
     
     FacetSearchParams fsp = new FacetSearchParams(new CountFacetRequest(CP_A, NUM_CHILDREN_CP_A), 
         new CountFacetRequest(CP_B, NUM_CHILDREN_CP_B));
@@ -349,7 +349,7 @@ public class CountingFacetsAggregatorTes
   public void testBigNumResults() throws Exception {
     DirectoryReader indexReader = DirectoryReader.open(indexDir);
     TaxonomyReader taxoReader = new DirectoryTaxonomyReader(taxoDir);
-    IndexSearcher searcher = new IndexSearcher(indexReader);
+    IndexSearcher searcher = newSearcher(indexReader);
     
     FacetSearchParams fsp = new FacetSearchParams(new CountFacetRequest(CP_A, Integer.MAX_VALUE), 
         new CountFacetRequest(CP_B, Integer.MAX_VALUE));
@@ -373,7 +373,7 @@ public class CountingFacetsAggregatorTes
   public void testNoParents() throws Exception {
     DirectoryReader indexReader = DirectoryReader.open(indexDir);
     TaxonomyReader taxoReader = new DirectoryTaxonomyReader(taxoDir);
-    IndexSearcher searcher = new IndexSearcher(indexReader);
+    IndexSearcher searcher = newSearcher(indexReader);
     FacetSearchParams fsp = new FacetSearchParams(fip, new CountFacetRequest(CP_C, NUM_CHILDREN_CP_C), 
         new CountFacetRequest(CP_D, NUM_CHILDREN_CP_D));
     FacetsCollector fc = FacetsCollector.create(randomAccumulator(fsp, indexReader, taxoReader));

Modified: lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestDrillSideways.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestDrillSideways.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestDrillSideways.java (original)
+++ lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestDrillSideways.java Mon Apr 15 20:38:06 2013
@@ -606,7 +606,7 @@ public class TestDrillSideways extends F
     TaxonomyReader tr = new DirectoryTaxonomyReader(tw);
     tw.close();
 
-    IndexSearcher s = new IndexSearcher(r);
+    IndexSearcher s = newSearcher(r);
 
     int numIters = atLeast(10);
 

Modified: lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestFacetsCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestFacetsCollector.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestFacetsCollector.java (original)
+++ lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestFacetsCollector.java Mon Apr 15 20:38:06 2013
@@ -89,7 +89,7 @@ public class TestFacetsCollector extends
     ConstantScoreQuery csq = new ConstantScoreQuery(new MatchAllDocsQuery());
     csq.setBoost(2.0f);
     
-    new IndexSearcher(r).search(csq, MultiCollector.wrap(fc, topDocs));
+    newSearcher(r).search(csq, MultiCollector.wrap(fc, topDocs));
     
     List<FacetResult> res = fc.getFacetResults();
     float value = (float) res.get(0).getFacetResultNode().value;
@@ -130,7 +130,7 @@ public class TestFacetsCollector extends
         new CountFacetRequest(new CategoryPath("a"), 10), 
         new CountFacetRequest(new CategoryPath("b"), 10));
     FacetsCollector fc = FacetsCollector.create(sParams, r, taxo);
-    new IndexSearcher(r).search(new MatchAllDocsQuery(), fc);
+    newSearcher(r).search(new MatchAllDocsQuery(), fc);
     
     for (FacetResult res : fc.getFacetResults()) {
       assertEquals("unexpected count for " + res, r.maxDoc(), (int) res.getFacetResultNode().value);
@@ -182,7 +182,7 @@ public class TestFacetsCollector extends
     
     FacetsCollector fc = FacetsCollector.create(fa);
     TopScoreDocCollector topDocs = TopScoreDocCollector.create(10, false);
-    new IndexSearcher(r).search(new MatchAllDocsQuery(), MultiCollector.wrap(fc, topDocs));
+    newSearcher(r).search(new MatchAllDocsQuery(), MultiCollector.wrap(fc, topDocs));
     
     List<FacetResult> facetResults = fc.getFacetResults();
     FacetResult fresA = facetResults.get(0);
@@ -221,7 +221,7 @@ public class TestFacetsCollector extends
     
     final FacetsAccumulator fa = random().nextBoolean() ? new FacetsAccumulator(fsp, r, taxo) : new StandardFacetsAccumulator(fsp, r, taxo);
     FacetsCollector fc = FacetsCollector.create(fa);
-    new IndexSearcher(r).search(new MatchAllDocsQuery(), fc);
+    newSearcher(r).search(new MatchAllDocsQuery(), fc);
     
     FacetResult res = fc.getFacetResults().get(0);
     for (FacetResultNode node : res.getFacetResultNode().subResults) {
@@ -255,7 +255,7 @@ public class TestFacetsCollector extends
         new CountFacetRequest(new CategoryPath("b"), 10));
     final FacetsAccumulator fa = random().nextBoolean() ? new FacetsAccumulator(fsp, r, taxo) : new StandardFacetsAccumulator(fsp, r, taxo);
     final FacetsCollector fc = FacetsCollector.create(fa);
-    new IndexSearcher(r).search(new MatchAllDocsQuery(), fc);
+    newSearcher(r).search(new MatchAllDocsQuery(), fc);
     
     List<FacetResult> res1 = fc.getFacetResults();
     List<FacetResult> res2 = fc.getFacetResults();
@@ -289,7 +289,7 @@ public class TestFacetsCollector extends
     final FacetsCollector fc = FacetsCollector.create(fa);
     // this should populate the cached results, but doing search should clear the cache
     fc.getFacetResults();
-    new IndexSearcher(r).search(new MatchAllDocsQuery(), fc);
+    newSearcher(r).search(new MatchAllDocsQuery(), fc);
     
     List<FacetResult> res1 = fc.getFacetResults();
     // verify that we didn't get the cached result
@@ -328,7 +328,7 @@ public class TestFacetsCollector extends
     FacetSearchParams fsp = new FacetSearchParams(new CountFacetRequest(new CategoryPath("a"), 10));
     FacetsAccumulator fa = random().nextBoolean() ? new FacetsAccumulator(fsp, r, taxo) : new StandardFacetsAccumulator(fsp, r, taxo);
     FacetsCollector fc = FacetsCollector.create(fa);
-    new IndexSearcher(r).search(new MatchAllDocsQuery(), fc);
+    newSearcher(r).search(new MatchAllDocsQuery(), fc);
     assertTrue("invalid ordinal for child node: 0", 0 != fc.getFacetResults().get(0).getFacetResultNode().subResults.get(0).ordinal);
     
     // assert IntFacetResultHandler
@@ -344,7 +344,7 @@ public class TestFacetsCollector extends
       fa = new StandardFacetsAccumulator(fsp, r, taxo);
     }
     fc = FacetsCollector.create(fa);
-    new IndexSearcher(r).search(new MatchAllDocsQuery(), fc);
+    newSearcher(r).search(new MatchAllDocsQuery(), fc);
     assertTrue("invalid ordinal for child node: 0", 0 != fc.getFacetResults().get(0).getFacetResultNode().subResults.get(0).ordinal);
     
     IOUtils.close(taxo, taxoDir, r, indexDir);
@@ -377,7 +377,7 @@ public class TestFacetsCollector extends
     FacetSearchParams fsp = new FacetSearchParams(cfr);
     final FacetsAccumulator fa = random().nextBoolean() ? new FacetsAccumulator(fsp, r, taxo) : new StandardFacetsAccumulator(fsp, r, taxo);
     FacetsCollector fc = FacetsCollector.create(fa);
-    new IndexSearcher(r).search(new MatchAllDocsQuery(), fc);
+    newSearcher(r).search(new MatchAllDocsQuery(), fc);
     
     FacetResult res = fc.getFacetResults().get(0);
     assertEquals(10, res.getNumValidDescendants());

Modified: lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestStandardFacetsAccumulator.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestStandardFacetsAccumulator.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestStandardFacetsAccumulator.java (original)
+++ lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/search/TestStandardFacetsAccumulator.java Mon Apr 15 20:38:06 2013
@@ -93,7 +93,7 @@ public class TestStandardFacetsAccumulat
 
     DirectoryReader indexReader = DirectoryReader.open(indexDir);
     TaxonomyReader taxoReader = new DirectoryTaxonomyReader(taxoDir);
-    IndexSearcher indexSearcher = new IndexSearcher(indexReader);
+    IndexSearcher indexSearcher = newSearcher(indexReader);
     
     // search for "f:a", only segments 1 and 3 should match results
     Query q = new TermQuery(new Term("f", "a"));

Modified: lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/util/TestFacetsPayloadMigrationReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/util/TestFacetsPayloadMigrationReader.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/util/TestFacetsPayloadMigrationReader.java (original)
+++ lucene/dev/branches/branch_4x/lucene/facet/src/test/org/apache/lucene/facet/util/TestFacetsPayloadMigrationReader.java Mon Apr 15 20:38:06 2013
@@ -229,7 +229,7 @@ public class TestFacetsPayloadMigrationR
       FacetIndexingParams fip) throws Exception {
     DirectoryReader indexReader = DirectoryReader.open(indexDir);
     TaxonomyReader taxoReader = new DirectoryTaxonomyReader(taxoDir);
-    IndexSearcher searcher = new IndexSearcher(indexReader);
+    IndexSearcher searcher = newSearcher(indexReader);
 
     assertFalse("index should not have deletions", indexReader.hasDeletions());
     

Modified: lucene/dev/branches/branch_4x/lucene/grouping/src/test/org/apache/lucene/search/grouping/AllGroupHeadsCollectorTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/grouping/src/test/org/apache/lucene/search/grouping/AllGroupHeadsCollectorTest.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/grouping/src/test/org/apache/lucene/search/grouping/AllGroupHeadsCollectorTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/grouping/src/test/org/apache/lucene/search/grouping/AllGroupHeadsCollectorTest.java Mon Apr 15 20:38:06 2013
@@ -112,7 +112,7 @@ public class AllGroupHeadsCollectorTest 
     w.addDocument(doc);
 
     IndexReader reader = w.getReader();
-    IndexSearcher indexSearcher = new IndexSearcher(reader);
+    IndexSearcher indexSearcher = newSearcher(reader);
     if (SlowCompositeReaderWrapper.class.isAssignableFrom(reader.getClass())) {
       canUseIDV = false;
     }

Modified: lucene/dev/branches/branch_4x/lucene/grouping/src/test/org/apache/lucene/search/grouping/AllGroupsCollectorTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/grouping/src/test/org/apache/lucene/search/grouping/AllGroupsCollectorTest.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/grouping/src/test/org/apache/lucene/search/grouping/AllGroupsCollectorTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/grouping/src/test/org/apache/lucene/search/grouping/AllGroupsCollectorTest.java Mon Apr 15 20:38:06 2013
@@ -99,7 +99,7 @@ public class AllGroupsCollectorTest exte
     doc.add(new Field("id", "6", customType));
     w.addDocument(doc);
 
-    IndexSearcher indexSearcher = new IndexSearcher(w.getReader());
+    IndexSearcher indexSearcher = newSearcher(w.getReader());
     w.close();
 
     AbstractAllGroupsCollector<?> allGroupsCollector = createRandomCollector(groupField, canUseIDV);

Modified: lucene/dev/branches/branch_4x/lucene/grouping/src/test/org/apache/lucene/search/grouping/GroupFacetCollectorTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/grouping/src/test/org/apache/lucene/search/grouping/GroupFacetCollectorTest.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/grouping/src/test/org/apache/lucene/search/grouping/GroupFacetCollectorTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/grouping/src/test/org/apache/lucene/search/grouping/GroupFacetCollectorTest.java Mon Apr 15 20:38:06 2013
@@ -87,7 +87,7 @@ public class GroupFacetCollectorTest ext
     addField(doc, "duration", "5", useDv);
     w.addDocument(doc);
 
-    IndexSearcher indexSearcher = new IndexSearcher(w.getReader());
+    IndexSearcher indexSearcher = newSearcher(w.getReader());
 
     List<TermGroupFacetCollector.FacetEntry> entries = null;
     AbstractGroupFacetCollector groupedAirportFacetCollector = null; 
@@ -168,7 +168,7 @@ public class GroupFacetCollectorTest ext
     w.addDocument(doc);
 
     indexSearcher.getIndexReader().close();
-    indexSearcher = new IndexSearcher(w.getReader());
+    indexSearcher = newSearcher(w.getReader());
     groupedAirportFacetCollector = createRandomCollector(useDv ? "hotel_dv" : "hotel", useDv ? "airport_dv" : "airport", null, !useDv);
     indexSearcher.search(new MatchAllDocsQuery(), groupedAirportFacetCollector);
     airportResult = groupedAirportFacetCollector.mergeSegmentResults(3, 0, true);
@@ -216,7 +216,7 @@ public class GroupFacetCollectorTest ext
     w.addDocument(doc);
 
     indexSearcher.getIndexReader().close();
-    indexSearcher = new IndexSearcher(w.getReader());
+    indexSearcher = newSearcher(w.getReader());
     groupedAirportFacetCollector = createRandomCollector(useDv ? "hotel_dv" : "hotel", useDv ? "airport_dv" : "airport", null, false);
     indexSearcher.search(new MatchAllDocsQuery(), groupedAirportFacetCollector);
     airportResult = groupedAirportFacetCollector.mergeSegmentResults(10, 0, false);
@@ -332,7 +332,7 @@ public class GroupFacetCollectorTest ext
     w.commit();
 
     w.close();
-    IndexSearcher indexSearcher = new IndexSearcher(DirectoryReader.open(dir));
+    IndexSearcher indexSearcher = newSearcher(DirectoryReader.open(dir));
     AbstractGroupFacetCollector groupedAirportFacetCollector = createRandomCollector(groupField, "airport", null, true);
     indexSearcher.search(new MatchAllDocsQuery(), groupedAirportFacetCollector);
     TermGroupFacetCollector.GroupedFacetResult airportResult = groupedAirportFacetCollector.mergeSegmentResults(10, 0, false);

Modified: lucene/dev/branches/branch_4x/lucene/grouping/src/test/org/apache/lucene/search/grouping/GroupingSearchTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/grouping/src/test/org/apache/lucene/search/grouping/GroupingSearchTest.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/grouping/src/test/org/apache/lucene/search/grouping/GroupingSearchTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/grouping/src/test/org/apache/lucene/search/grouping/GroupingSearchTest.java Mon Apr 15 20:38:06 2013
@@ -118,7 +118,7 @@ public class GroupingSearchTest extends 
 
     w.addDocument(doc);
 
-    IndexSearcher indexSearcher = new IndexSearcher(w.getReader());
+    IndexSearcher indexSearcher = newSearcher(w.getReader());
     w.close();
 
     Sort groupSort = Sort.RELEVANCE;
@@ -233,7 +233,7 @@ public class GroupingSearchTest extends 
     doc.add(newField("group", "foo", StringField.TYPE_NOT_STORED));
     w.addDocument(doc);
 
-    IndexSearcher indexSearcher = new IndexSearcher(w.getReader());
+    IndexSearcher indexSearcher = newSearcher(w.getReader());
     w.close();
 
     GroupingSearch gs = new GroupingSearch("group");

Modified: lucene/dev/branches/branch_4x/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java (original)
+++ lucene/dev/branches/branch_4x/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java Mon Apr 15 20:38:06 2013
@@ -116,7 +116,7 @@ public class TestGrouping extends Lucene
     doc.add(new Field("id", "6", customType));
     w.addDocument(doc);
 
-    IndexSearcher indexSearcher = new IndexSearcher(w.getReader());
+    IndexSearcher indexSearcher = newSearcher(w.getReader());
     w.close();
 
     final Sort groupSort = Sort.RELEVANCE;

Modified: lucene/dev/branches/branch_4x/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java Mon Apr 15 20:38:06 2013
@@ -90,7 +90,7 @@ public class HighlighterTest extends Bas
     phraseQuery.add(new Term(FIELD_NAME, "long"));
 
     query = phraseQuery;
-    searcher = new IndexSearcher(reader);
+    searcher = newSearcher(reader);
     TopDocs hits = searcher.search(query, 10);
     
     QueryScorer scorer = new QueryScorer(query, FIELD_NAME);
@@ -121,7 +121,7 @@ public class HighlighterTest extends Bas
     query.add(new Term(FIELD_NAME, "long"));
     query.add(new Term(FIELD_NAME, "very"));
 
-    searcher = new IndexSearcher(reader);
+    searcher = newSearcher(reader);
     TopDocs hits = searcher.search(query, 10);
     assertEquals(2, hits.totalHits);
     QueryScorer scorer = new QueryScorer(query, FIELD_NAME);
@@ -163,12 +163,21 @@ public class HighlighterTest extends Bas
       public String toString(String field) {
         return null;
       }
-      
+
+      @Override
+      public int hashCode() {
+        return 31 * super.hashCode();
+      }
+
+      @Override
+      public boolean equals(Object obj) {
+        return super.equals(obj);
+      }
     };
     
     Analyzer analyzer = new MockAnalyzer(random(), MockTokenizer.SIMPLE, true);
     
-    searcher = new IndexSearcher(reader);
+    searcher = newSearcher(reader);
     TopDocs hits = searcher.search(query, 10);
     assertEquals(2, hits.totalHits);
     QueryScorer scorer = new QueryScorer(query, FIELD_NAME);
@@ -412,7 +421,7 @@ public class HighlighterTest extends Bas
   
   public void testSpanRegexQuery() throws Exception {
     query = new SpanOrQuery(new SpanMultiTermQueryWrapper<RegexpQuery>(new RegexpQuery(new Term(FIELD_NAME, "ken.*"))));
-    searcher = new IndexSearcher(reader);
+    searcher = newSearcher(reader);
     hits = searcher.search(query, 100);
     int maxNumFragmentsRequired = 2;
 
@@ -436,7 +445,7 @@ public class HighlighterTest extends Bas
   
   public void testRegexQuery() throws Exception {
     query = new RegexpQuery(new Term(FIELD_NAME, "ken.*"));
-    searcher = new IndexSearcher(reader);
+    searcher = newSearcher(reader);
     hits = searcher.search(query, 100);
     int maxNumFragmentsRequired = 2;
 
@@ -460,7 +469,7 @@ public class HighlighterTest extends Bas
   
   public void testExternalReader() throws Exception {
     query = new RegexpQuery(new Term(FIELD_NAME, "ken.*"));
-    searcher = new IndexSearcher(reader);
+    searcher = newSearcher(reader);
     hits = searcher.search(query, 100);
     int maxNumFragmentsRequired = 2;
 
@@ -486,7 +495,7 @@ public class HighlighterTest extends Bas
   public void testNumericRangeQuery() throws Exception {
     // doesn't currently highlight, but make sure it doesn't cause exception either
     query = NumericRangeQuery.newIntRange(NUMERIC_FIELD_NAME, 2, 6, true, true);
-    searcher = new IndexSearcher(reader);
+    searcher = newSearcher(reader);
     hits = searcher.search(query, 100);
     int maxNumFragmentsRequired = 2;
 
@@ -885,7 +894,7 @@ public class HighlighterTest extends Bas
 
     query = new WildcardQuery(new Term(FIELD_NAME, "ken*"));
     ((WildcardQuery)query).setRewriteMethod(MultiTermQuery.CONSTANT_SCORE_FILTER_REWRITE);
-    searcher = new IndexSearcher(reader);
+    searcher = newSearcher(reader);
     // can't rewrite ConstantScore if you want to highlight it -
     // it rewrites to ConstantScoreQuery which cannot be highlighted
     // query = unReWrittenQuery.rewrite(reader);
@@ -1400,7 +1409,7 @@ public class HighlighterTest extends Bas
       public void run() throws Exception {
         numHighlights = 0;
         // test to show how rewritten query can still be used
-        searcher = new IndexSearcher(reader);
+        searcher = newSearcher(reader);
         Analyzer analyzer = new MockAnalyzer(random(), MockTokenizer.SIMPLE, true, MockTokenFilter.ENGLISH_STOPSET, true);
         
         BooleanQuery query = new BooleanQuery();
@@ -1780,7 +1789,7 @@ public class HighlighterTest extends Bas
   private void searchIndex() throws IOException, InvalidTokenOffsetsException {
     Query query = new TermQuery(new Term("t_text1", "random"));
     IndexReader reader = DirectoryReader.open(dir);
-    IndexSearcher searcher = new IndexSearcher(reader);
+    IndexSearcher searcher = newSearcher(reader);
     // This scorer can return negative idf -> null fragment
     Scorer scorer = new QueryTermScorer( query, searcher.getIndexReader(), "t_text1" );
     // This scorer doesn't use idf (patch version)
@@ -1833,7 +1842,7 @@ public class HighlighterTest extends Bas
   }
 
   public void doSearching(Query unReWrittenQuery) throws Exception {
-    searcher = new IndexSearcher(reader);
+    searcher = newSearcher(reader);
     // for any multi-term queries to work (prefix, wildcard, range,fuzzy etc)
     // you must use a rewritten query!
     query = unReWrittenQuery.rewrite(reader);

Modified: lucene/dev/branches/branch_4x/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/FastVectorHighlighterTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/FastVectorHighlighterTest.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/FastVectorHighlighterTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/FastVectorHighlighterTest.java Mon Apr 15 20:38:06 2013
@@ -272,7 +272,7 @@ public class FastVectorHighlighterTest e
    
     FastVectorHighlighter highlighter = new FastVectorHighlighter();
     IndexReader reader = DirectoryReader.open(writer, true);
-    IndexSearcher searcher = new IndexSearcher(reader);
+    IndexSearcher searcher = newSearcher(reader);
     TopDocs hits = searcher.search(query, 10);
     assertEquals(2, hits.totalHits);
     FieldQuery fieldQuery  = highlighter.getFieldQuery(query, reader);

Modified: lucene/dev/branches/branch_4x/lucene/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java Mon Apr 15 20:38:06 2013
@@ -242,7 +242,7 @@ public class MemoryIndexTest extends Bas
    */
   public void assertAllQueries(MemoryIndex memory, Directory ramdir, Analyzer analyzer) throws Exception {
     IndexReader reader = DirectoryReader.open(ramdir);
-    IndexSearcher ram = new IndexSearcher(reader);
+    IndexSearcher ram = newSearcher(reader);
     IndexSearcher mem = memory.createSearcher();
     QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, "foo", analyzer);
     for (String query : queries) {

Modified: lucene/dev/branches/branch_4x/lucene/misc/src/test/org/apache/lucene/document/TestLazyDocument.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/misc/src/test/org/apache/lucene/document/TestLazyDocument.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/misc/src/test/org/apache/lucene/document/TestLazyDocument.java (original)
+++ lucene/dev/branches/branch_4x/lucene/misc/src/test/org/apache/lucene/document/TestLazyDocument.java Mon Apr 15 20:38:06 2013
@@ -84,7 +84,7 @@ public class TestLazyDocument extends Lu
     IndexReader reader = DirectoryReader.open(dir);
     try {
       Query q = new TermQuery(new Term("docid", ""+id));
-      IndexSearcher searcher = new IndexSearcher(reader);
+      IndexSearcher searcher = newSearcher(reader);
       ScoreDoc[] hits = searcher.search(q, 100).scoreDocs;
       assertEquals("Too many docs", 1, hits.length);
       LazyTestingStoredFieldVisitor visitor 

Modified: lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/CommonTermsQueryTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/CommonTermsQueryTest.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/CommonTermsQueryTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/CommonTermsQueryTest.java Mon Apr 15 20:38:06 2013
@@ -332,7 +332,7 @@ public class CommonTermsQueryTest extend
       List<TermAndFreq> highTerms = queueToList(highFreqQueue);
       List<TermAndFreq> lowTerms = queueToList(lowFreqQueue);
       
-      IndexSearcher searcher = new IndexSearcher(reader);
+      IndexSearcher searcher = newSearcher(reader);
       Occur lowFreqOccur = randomOccur(random());
       BooleanQuery verifyQuery = new BooleanQuery();
       CommonTermsQuery cq = new CommonTermsQuery(randomOccur(random()),

Modified: lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/TermsFilterTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/TermsFilterTest.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/TermsFilterTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/TermsFilterTest.java Mon Apr 15 20:38:06 2013
@@ -222,7 +222,7 @@ public class TermsFilterTest extends Luc
     IndexReader reader = w.getReader();
     w.close();
     
-    IndexSearcher searcher = new IndexSearcher(reader);
+    IndexSearcher searcher = newSearcher(reader);
     
     int numQueries = atLeast(10);
     for (int i = 0; i < numQueries; i++) {

Modified: lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/TestCustomScoreQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/TestCustomScoreQuery.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/TestCustomScoreQuery.java (original)
+++ lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/TestCustomScoreQuery.java Mon Apr 15 20:38:06 2013
@@ -46,6 +46,8 @@ import org.apache.lucene.index.Term;
  */
 public class TestCustomScoreQuery extends FunctionTestSetup {
 
+  // TODO: why can't this test use newSearcher?
+  
   @BeforeClass
   public static void beforeClass() throws Exception {
     createIndex(true);

Modified: lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/function/TestFieldScoreQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/function/TestFieldScoreQuery.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/function/TestFieldScoreQuery.java (original)
+++ lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/function/TestFieldScoreQuery.java Mon Apr 15 20:38:06 2013
@@ -83,7 +83,7 @@ public class TestFieldScoreQuery extends
   private void doTestRank (ValueSource valueSource) throws Exception {
     FunctionQuery functionQuery = new FunctionQuery(valueSource);
     IndexReader r = DirectoryReader.open(dir);
-    IndexSearcher s = new IndexSearcher(r);
+    IndexSearcher s = newSearcher(r);
     log("test: "+ functionQuery);
     QueryUtils.check(random(), functionQuery,s);
     ScoreDoc[] h = s.search(functionQuery, null, 1000).scoreDocs;
@@ -132,7 +132,7 @@ public class TestFieldScoreQuery extends
   private void doTestExactScore (ValueSource valueSource) throws Exception {
     FunctionQuery functionQuery = new FunctionQuery(valueSource);
     IndexReader r = DirectoryReader.open(dir);
-    IndexSearcher s = new IndexSearcher(r);
+    IndexSearcher s = newSearcher(r);
     TopDocs td = s.search(functionQuery,null,1000);
     assertEquals("All docs should be matched!",N_DOCS,td.totalHits);
     ScoreDoc sd[] = td.scoreDocs;

Modified: lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/function/TestOrdValues.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/function/TestOrdValues.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/function/TestOrdValues.java (original)
+++ lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/function/TestOrdValues.java Mon Apr 15 20:38:06 2013
@@ -66,7 +66,7 @@ public class TestOrdValues extends Funct
   // Test that queries based on reverse/ordFieldScore scores correctly
   private void doTestRank(String field, boolean inOrder) throws Exception {
     IndexReader r = DirectoryReader.open(dir);
-    IndexSearcher s = new IndexSearcher(r);
+    IndexSearcher s = newSearcher(r);
     ValueSource vs;
     if (inOrder) {
       vs = new OrdFieldSource(field);
@@ -117,7 +117,7 @@ public class TestOrdValues extends Funct
   // Test that queries based on reverse/ordFieldScore returns docs with expected score.
   private void doTestExactScore(String field, boolean inOrder) throws Exception {
     IndexReader r = DirectoryReader.open(dir);
-    IndexSearcher s = new IndexSearcher(r);
+    IndexSearcher s = newSearcher(r);
     ValueSource vs;
     if (inOrder) {
       vs = new OrdFieldSource(field);

Modified: lucene/dev/branches/branch_4x/lucene/queryparser/src/java/org/apache/lucene/queryparser/complexPhrase/ComplexPhraseQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/queryparser/src/java/org/apache/lucene/queryparser/complexPhrase/ComplexPhraseQueryParser.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/queryparser/src/java/org/apache/lucene/queryparser/complexPhrase/ComplexPhraseQueryParser.java (original)
+++ lucene/dev/branches/branch_4x/lucene/queryparser/src/java/org/apache/lucene/queryparser/complexPhrase/ComplexPhraseQueryParser.java Mon Apr 15 20:38:06 2013
@@ -363,7 +363,7 @@ public class ComplexPhraseQueryParser ex
     @Override
     public int hashCode() {
       final int prime = 31;
-      int result = 1;
+      int result = super.hashCode();
       result = prime * result + ((field == null) ? 0 : field.hashCode());
       result = prime
           * result
@@ -381,6 +381,9 @@ public class ComplexPhraseQueryParser ex
         return false;
       if (getClass() != obj.getClass())
         return false;
+      if (!super.equals(obj)) {
+        return false;
+      }
       ComplexPhraseQuery other = (ComplexPhraseQuery) obj;
       if (field == null) {
         if (other.field != null)

Modified: lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/analyzing/TestAnalyzingQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/analyzing/TestAnalyzingQueryParser.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/analyzing/TestAnalyzingQueryParser.java (original)
+++ lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/analyzing/TestAnalyzingQueryParser.java Mon Apr 15 20:38:06 2013
@@ -166,7 +166,7 @@ public class TestAnalyzingQueryParser ex
     writer.addDocument(doc);
     writer.close();
     DirectoryReader ir = DirectoryReader.open(ramDir);
-    IndexSearcher is = new IndexSearcher(ir);
+    IndexSearcher is = newSearcher(ir);
     QueryParser qp = new AnalyzingQueryParser(TEST_VERSION_CURRENT, "content", analyzer);
     Query q = qp.parse("[เข TO เข]");
     assertEquals(1, is.search(q, 10).totalHits);

Modified: lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiFieldQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiFieldQueryParser.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiFieldQueryParser.java (original)
+++ lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiFieldQueryParser.java Mon Apr 15 20:38:06 2013
@@ -297,7 +297,7 @@ public class TestMultiFieldQueryParser e
     mfqp.setDefaultOperator(QueryParser.Operator.AND);
     Query q = mfqp.parse("the footest");
     IndexReader ir = DirectoryReader.open(ramDir);
-    IndexSearcher is = new IndexSearcher(ir);
+    IndexSearcher is = newSearcher(ir);
     ScoreDoc[] hits = is.search(q, null, 1000).scoreDocs;
     assertEquals(1, hits.length);
     ir.close();

Modified: lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java (original)
+++ lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java Mon Apr 15 20:38:06 2013
@@ -126,7 +126,7 @@ public class TestComplexPhraseQuery exte
     }
     w.close();
     reader = DirectoryReader.open(rd);
-    searcher = new IndexSearcher(reader);
+    searcher = newSearcher(reader);
   }
 
   @Override

Modified: lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestMultiFieldQPHelper.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestMultiFieldQPHelper.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestMultiFieldQPHelper.java (original)
+++ lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestMultiFieldQPHelper.java Mon Apr 15 20:38:06 2013
@@ -333,7 +333,7 @@ public class TestMultiFieldQPHelper exte
     mfqp.setDefaultOperator(StandardQueryConfigHandler.Operator.AND);
     Query q = mfqp.parse("the footest", null);
     IndexReader ir = DirectoryReader.open(ramDir);
-    IndexSearcher is = new IndexSearcher(ir);
+    IndexSearcher is = newSearcher(ir);
     ScoreDoc[] hits = is.search(q, null, 1000).scoreDocs;
     assertEquals(1, hits.length);
     ir.close();

Modified: lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestQueryTemplateManager.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestQueryTemplateManager.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestQueryTemplateManager.java (original)
+++ lucene/dev/branches/branch_4x/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestQueryTemplateManager.java Mon Apr 15 20:38:06 2013
@@ -152,7 +152,7 @@ public class TestQueryTemplateManager ex
     w.forceMerge(1);
     w.close();
     reader = DirectoryReader.open(dir);
-    searcher = new IndexSearcher(reader);
+    searcher = newSearcher(reader);
 
     //initialize the parser
     builder = new CorePlusExtensionsParser("artist", analyzer);

Modified: lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/regex/TestSpanRegexQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/regex/TestSpanRegexQuery.java?rev=1468217&r1=1468216&r2=1468217&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/regex/TestSpanRegexQuery.java (original)
+++ lucene/dev/branches/branch_4x/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/regex/TestSpanRegexQuery.java Mon Apr 15 20:38:06 2013
@@ -69,7 +69,7 @@ public class TestSpanRegexQuery extends 
     writer.close();
 
     IndexReader reader = DirectoryReader.open(directory);
-    IndexSearcher searcher = new IndexSearcher(reader);
+    IndexSearcher searcher = newSearcher(reader);
     SpanQuery srq = new SpanMultiTermQueryWrapper<RegexQuery>(new RegexQuery(new Term("field", "aut.*")));
     SpanFirstQuery sfq = new SpanFirstQuery(srq, 1);
     // SpanNearQuery query = new SpanNearQuery(new SpanQuery[] {srq, stq}, 6,



Mime
View raw message