Examples of explain()


Examples of nux.xom.xquery.XQuery.explain()

         
          if (isBench) {
            System.out.println("query = " +query);
          }
          if (explain && run == 0 && xquery != null) {
            System.out.println("explain = \n" + xquery.explain());
          }
         
          XQuery morpher;
          if (update instanceof String) {
            morpher = queryPool.getXQuery((String)update, null);
View Full Code Here

Examples of org.apache.lucene.queries.function.FunctionValues.explain()

      }

      @Override
      public Explanation explain(int doc) {
        Explanation exp = super.explain(doc);
        exp.addDetail(shapeValues.explain(doc));
        return exp;
      }
    };
  }
View Full Code Here

Examples of org.apache.lucene.search.IndexSearcher.explain()

    assertEquals("All docs should be matched!",N_DOCS,h.length);
    String prevID = "ID"+(N_DOCS+1); // greater than all ids of docs in this test
    for (int i=0; i<h.length; i++) {
      String resID = s.doc(h[i].doc).get(ID_FIELD);
      log(i+".   score="+h[i].score+"  -  "+resID);
      log(s.explain(q,h[i].doc));
      assertTrue("res id "+resID+" should be < prev res id "+prevID, resID.compareTo(prevID)<0);
      prevID = resID;
    }
    s.close();
  }
View Full Code Here

Examples of org.apache.lucene.search.IndexSearcher.explain()

    TopDocs td = s.search(q,null,1000);
    assertEquals("All docs should be matched!",N_DOCS,td.totalHits);
    ScoreDoc sd[] = td.scoreDocs;
    for (ScoreDoc aSd : sd) {
      float score = aSd.score;
      log(s.explain(q, aSd.doc));
      String id = s.getIndexReader().document(aSd.doc).get(ID_FIELD);
      float expectedScore = expectedFieldScore(id); // "ID7" --> 7.0
      assertEquals("score of " + id + " shuould be " + expectedScore + " != " + score, expectedScore, score, TEST_SCORE_TOLERANCE_DELTA);
    }
    s.close();
View Full Code Here

Examples of org.apache.lucene.search.IndexSearcher.explain()

      : "IC"// smaller than all ids of docs in this test ("ID0001", etc.)
         
    for (int i=0; i<h.length; i++) {
      String resID = s.doc(h[i].doc).get(ID_FIELD);
      log(i+".   score="+h[i].score+"  -  "+resID);
      log(s.explain(q,h[i].doc));
      if (inOrder) {
        assertTrue("res id "+resID+" should be < prev res id "+prevID, resID.compareTo(prevID)<0);
      } else {
        assertTrue("res id "+resID+" should be > prev res id "+prevID, resID.compareTo(prevID)>0);
      }
View Full Code Here

Examples of org.apache.lucene.search.IndexSearcher.explain()

    ScoreDoc sd[] = td.scoreDocs;
    for (int i=0; i<sd.length; i++) {
      float score = sd[i].score;
      String id = s.getIndexReader().document(sd[i].doc).get(ID_FIELD);
      log("-------- "+i+". Explain doc "+id);
      log(s.explain(q,sd[i].doc));
      float expectedScore =  N_DOCS-i;
      assertEquals("score of result "+i+" shuould be "+expectedScore+" != "+score, expectedScore, score, TEST_SCORE_TOLERANCE_DELTA);
      String expectedId =  inOrder
        ? id2String(N_DOCS-i) // in-order ==> larger  values first
        : id2String(i+1);     // reverse  ==> smaller values first
View Full Code Here

Examples of org.apache.lucene.search.IndexSearcher.explain()

    assertEquals("All docs should be matched!",N_DOCS,h.length);
    String prevID = "ID"+(N_DOCS+1); // greater than all ids of docs in this test
    for (int i=0; i<h.length; i++) {
      String resID = s.doc(h[i].doc).get(ID_FIELD);
      log(i+".   score="+h[i].score+"  -  "+resID);
      log(s.explain(q,h[i].doc));
      assertTrue("res id "+resID+" should be < prev res id "+prevID, resID.compareTo(prevID)<0);
      prevID = resID;
    }
  }
View Full Code Here

Examples of org.apache.lucene.search.IndexSearcher.explain()

    TopDocs td = s.search(q,null,1000);
    assertEquals("All docs should be matched!",N_DOCS,td.totalHits);
    ScoreDoc sd[] = td.scoreDocs;
    for (int i=0; i<sd.length; i++) {
      float score = sd[i].score;
      log(s.explain(q,sd[i].doc));
      String id = s.getIndexReader().document(sd[i].doc).get(ID_FIELD);
      float expectedScore = expectedFieldScore(id); // "ID7" --> 7.0
      assertEquals("score of "+id+" shuould be "+expectedScore+" != "+score, expectedScore, score, TEST_SCORE_TOLERANCE_DELTA);
    }
  }
View Full Code Here

Examples of org.apache.lucene.search.IndexSearcher.explain()

    // test slop:
    query3.setSlop(1);
    result = searcher.search(query3, null, 1000).scoreDocs;

    // just make sure no exc:
    searcher.explain(query3, 0);

    assertEquals(3, result.length); // blueberry pizza, bluebird pizza, bluebird foobar pizza

    MultiPhraseQuery query4 = new MultiPhraseQuery();
    try {
View Full Code Here

Examples of org.apache.lucene.search.IndexSearcher.explain()

    ScoreDoc[] hits = searcher.search(q, null, 1000).scoreDocs;
   
    assertEquals("Wrong number of hits", 2, hits.length);
   
    // just make sure no exc:
    searcher.explain(q, 0);
   
    writer.close();
    searcher.close();
    reader.close();
    indexStore.close();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.