Ejemplo n.º 1
0
 /** not a direct test of NearSpans, but a demonstration of how/when this causes problems */
 public void testSpanNearScorerExplain() throws Exception {
   SpanNearQuery q = makeQuery();
   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());
 }
Ejemplo n.º 2
0
 /** not a direct test of NearSpans, but a demonstration of how/when this causes problems */
 public void testSpanNearScorerSkipTo1() throws Exception {
   SpanNearQuery q = makeQuery();
   Weight w = q.weight(searcher);
   Scorer s = w.scorer(searcher.getIndexReader(), true, false);
   assertEquals(1, s.advance(1));
 }