Index: src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java =================================================================== --- src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java (revision 829251) +++ src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java (working copy) @@ -169,9 +169,7 @@ */ public void testSpanNearScorerExplain() throws Exception { SpanNearQuery q = makeQuery(); - Weight w = q.weight(searcher); - Scorer s = w.scorer(searcher.getIndexReader(), true, false); - Explanation e = s.explain(1); + Explanation e = q.weight(searcher).explain(searcher.getIndexReader(), 1); assertTrue("Scorer explanation value for doc#1 isn't positive: " + e.toString(), 0.0f < e.getValue()); Index: src/test/org/apache/lucene/search/TestTermScorer.java =================================================================== --- src/test/org/apache/lucene/search/TestTermScorer.java (revision 829251) +++ src/test/org/apache/lucene/search/TestTermScorer.java (working copy) @@ -158,49 +158,6 @@ assertTrue("doc should be number 5", ts.docID() == 5); } - public void testExplain() throws Exception - { - Term allTerm = new Term(FIELD, "all"); - TermQuery termQuery = new TermQuery(allTerm); - - Weight weight = termQuery.weight(indexSearcher); - - TermScorer ts = new TermScorer(weight, - indexReader.termDocs(allTerm), indexSearcher.getSimilarity(), - indexReader.norms(FIELD)); - Explanation explanation = ts.explain(0); - assertTrue("explanation is null and it shouldn't be", explanation != null); - //System.out.println("Explanation: " + explanation.toString()); - //All this Explain does is return the term frequency - assertTrue("term frq is not 1", explanation.getValue() == 1); - explanation = ts.explain(1); - assertTrue("explanation is null and it shouldn't be", explanation != null); - //System.out.println("Explanation: " + explanation.toString()); - //All this Explain does is return the term frequency - assertTrue("term frq is not 0", explanation.getValue() == 0); - - Term dogsTerm = new Term(FIELD, "dogs"); - termQuery = new TermQuery(dogsTerm); - weight = termQuery.weight(indexSearcher); - - ts = new TermScorer(weight, indexReader.termDocs(dogsTerm), indexSearcher.getSimilarity(), - indexReader.norms(FIELD)); - explanation = ts.explain(1); - assertTrue("explanation is null and it shouldn't be", explanation != null); - //System.out.println("Explanation: " + explanation.toString()); - //All this Explain does is return the term frequency - float sqrtTwo = (float)Math.sqrt(2.0f); - assertTrue("term frq: " + explanation.getValue() + " is not the square root of 2", explanation.getValue() == sqrtTwo); - - explanation = ts.explain(10);//try a doc out of range - assertTrue("explanation is null and it shouldn't be", explanation != null); - //System.out.println("Explanation: " + explanation.toString()); - //All this Explain does is return the term frequency - - assertTrue("term frq: " + explanation.getValue() + " is not 0", explanation.getValue() == 0); - - } - private class TestHit { public int doc; public float score;