Examples of topDocs()


Examples of org.apache.lucene.search.TopScoreDocCollector.topDocs()

   
    newSearcher(r).search(csq, MultiCollector.wrap(fc, topDocs));
   
    List<FacetResult> res = fc.getFacetResults();
    float value = (float) res.get(0).getFacetResultNode().value;
    TopDocs td = topDocs.topDocs();
    int expected = (int) (td.getMaxScore() * td.totalHits);
    assertEquals(expected, (int) value);
   
    IOUtils.close(taxo, taxoDir, r, indexDir);
  }
View Full Code Here

Examples of org.apache.lucene.search.TopScoreDocCollector.topDocs()

    List<FacetResult> facetResults = fc.getFacetResults();
    FacetResult fresA = facetResults.get(0);
    assertEquals("unexpected count for " + fresA, r.maxDoc(), (int) fresA.getFacetResultNode().value);
   
    FacetResult fresB = facetResults.get(1);
    double expected = topDocs.topDocs().getMaxScore() * r.numDocs();
    assertEquals("unexpected value for " + fresB, expected, fresB.getFacetResultNode().value, 1E-10);
   
    IOUtils.close(taxo, taxoDir, r, indexDir);
  }
 
View Full Code Here

Examples of org.elasticsearch.search.query.QuerySearchResult.topDocs()

        assertThat(dfsResult.freqs()[0], equalTo(1));
    }

    @Test public void testDirectQuery() throws Exception {
        QuerySearchResult queryResult = searchService.executeQueryPhase(searchRequest(searchSource().query(termQuery("name", "test1")), SearchType.QUERY_THEN_FETCH));
        assertThat(queryResult.topDocs().totalHits, equalTo(1));
    }

    @Test public void testDirectFetch() throws Exception {
        QueryFetchSearchResult queryFetchResult = searchService.executeFetchPhase(searchRequest(searchSource().query(termQuery("name", "test1")), SearchType.QUERY_AND_FETCH));
        assertThat(queryFetchResult.queryResult().topDocs().totalHits, equalTo(1));
View Full Code Here

Examples of uk.ac.ucl.panda.retrieval.TopDocCollector.topDocs()

        // System.out.println(temp[d].doc+"  "+temp[i].doc);
        // System.out.println("Score: "+temp[i].score +
        // " Correlation: "+correlation(temp[d].doc,temp[i].doc));
        collector.collect(temp[i].doc, temp[i].score);
      }
      f_td = collector.topDocs();
      temp = f_td.scoreDocs;
    }
    return f_td;
  }
View Full Code Here

Examples of uk.ac.ucl.panda.retrieval.TopMeanVarianceDocCollector.topDocs()

        // System.out.println("Score: "+temp[i].score +
        // " Correlation: "+correlation(temp[d].doc,temp[i].doc));
        collector.collect(temp[i].doc, temp[i].score, temp[i].mean,
            temp[i].variance);
      }
      f_td = collector.topDocs();
      temp = f_td.MeanVariancescoreDocs;
    }
    return f_td;
  }
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.