Examples of TopDocs


Examples of org.apache.lucene.search.TopDocs

    flt.addTerms("fernando smith", "name", 0.3f, 1);
    Query q = flt.rewrite(searcher.getIndexReader());
    HashSet<Term> queryTerms = new HashSet<Term>();
    q.extractTerms(queryTerms);
    assertTrue("Should have variant smith", queryTerms.contains(new Term("name", "smith")));
    TopDocs topDocs = searcher.search(flt, 1);
    ScoreDoc[] sd = topDocs.scoreDocs;
    assertTrue("score docs must match 1 doc", (sd != null) && (sd.length > 0));
    Document doc = searcher.doc(sd[0].doc);
    assertEquals("Should match most similar when using 2 words", "2", doc.get("id"));
  }
View Full Code Here

Examples of uk.ac.ucl.panda.retrieval.TopDocs

  }

  // Correlation adjust the TOP 10 rank
  private TopDocs Correlation_Adjust(TopDocs td, double c) throws IOException {
    double log2toe = 1.0d / Math.log(2.0d);
    TopDocs f_td = td;
    ScoreDoc temp[] = f_td.scoreDocs;
    // System.out.println("number: "+temp.length);
    TopDocCollector collector = null;
    for (int d = 0; d < 19; d++) {
      collector = new TopDocCollector(temp.length);
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.