Package org.apache.lucene.facet.search

Examples of org.apache.lucene.facet.search.ScoredDocIdCollector$ScoringDocIdCollector


      try {
        initIndex(partitionSize);
        // Get all of the documents and run the query, then do different
        // facet counts and compare to control
        Query q = new TermQuery(new Term(CONTENT_FIELD, BETA)); // 90% of the docs
        ScoredDocIdCollector docCollector = ScoredDocIdCollector.create(searcher.maxDoc(), false);
       
        FacetSearchParams expectedSearchParams = searchParamsWithRequests(K, partitionSize);
        FacetsCollector fc = new FacetsCollector(expectedSearchParams, indexReader, taxoReader);
       
        searcher.search(q, MultiCollector.wrap(docCollector, fc));
       
        List<FacetResult> expectedResults = fc.getFacetResults();
       
        FacetSearchParams samplingSearchParams = searchParamsWithRequests(K, partitionSize);
       
        // try several times in case of failure, because the test has a chance to fail
        // if the top K facets are not sufficiently common with the sample set
        for (int nTrial=0; nTrial<RETRIES; nTrial++) {
          try {
            // complement with sampling!
            final Sampler sampler = createSampler(nTrial, docCollector.getScoredDocIDs(), useRandomSampler);
           
            assertSampling(expectedResults, q, sampler, samplingSearchParams, false);
            assertSampling(expectedResults, q, sampler, samplingSearchParams, true);
           
            break; // succeeded
View Full Code Here

TOP

Related Classes of org.apache.lucene.facet.search.ScoredDocIdCollector$ScoringDocIdCollector

Copyright © 2018 www.massapicom. 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.