Package org.apache.lucene.facet.search

Examples of org.apache.lucene.facet.search.FacetResultsHandler


    setAllowLabeling(origAllowLabeling);
   
    List<FacetResult> fixedRes = new ArrayList<FacetResult>();
    for (FacetResult fres : sampleRes) {
      // for sure fres is not null because this is guaranteed by the delegee.
      FacetResultsHandler frh = fres.getFacetRequest().createFacetResultsHandler(
          taxonomyReader);
      // fix the result of current request
      sampler.getSampleFixer(indexReader, taxonomyReader, searchParams)
          .fixResult(docids, fres);
     
      fres = frh.rearrangeFacetResult(fres); // let delegee's handler do any

      // Using the sampler to trim the extra (over-sampled) results
      fres = sampler.trimResult(fres);
                                              // arranging it needs to
      // final labeling if allowed (because labeling is a costly operation)
      if (isAllowLabeling()) {
        frh.labelResult(fres);
      }
      fixedRes.add(fres); // add to final results
    }
   
    searchParams = original; // Back to original params
View Full Code Here


    // create empty indexes, so that LTR ctor won't complain about a missing index.
    new IndexWriter(dir1, new IndexWriterConfig(TEST_VERSION_CURRENT, null)).close();
    new IndexWriter(dir2, new IndexWriterConfig(TEST_VERSION_CURRENT, null)).close();
    TaxonomyReader tr1 = new LuceneTaxonomyReader(dir1);
    TaxonomyReader tr2 = new LuceneTaxonomyReader(dir2);
    FacetResultsHandler frh1 = fr.createFacetResultsHandler(tr1);
    FacetResultsHandler frh2 = fr.createFacetResultsHandler(tr2);
    assertTrue("should not return the same FacetResultHandler instance for different TaxonomyReader instances", frh1 != frh2);
    tr1.close();
    tr2.close();
    dir1.close();
    dir2.close();
View Full Code Here

    FacetRequest fr = new CountFacetRequest(new CategoryPath("a"), 10);
    Directory dir = newDirectory();
    // create empty indexes, so that LTR ctor won't complain about a missing index.
    new IndexWriter(dir, new IndexWriterConfig(TEST_VERSION_CURRENT, null)).close();
    TaxonomyReader tr = new LuceneTaxonomyReader(dir);
    FacetResultsHandler frh = fr.createFacetResultsHandler(tr);
    fr.setDepth(10);
    assertEquals(FacetRequest.DEFAULT_DEPTH, frh.getFacetRequest().getDepth());
    tr.close();
    dir.close();
  }
View Full Code Here

                    // rollup values
                    aggregator.rollupValues(fr, rootOrd, children, siblings, facetArrays);
                }
            }

            FacetResultsHandler frh = createFacetResultsHandler(fr);
            res.add(frh.compute());
        }
        return res;
    }
View Full Code Here

    // create empty indexes, so that LTR ctor won't complain about a missing index.
    new IndexWriter(dir1, new IndexWriterConfig(TEST_VERSION_CURRENT, null)).close();
    new IndexWriter(dir2, new IndexWriterConfig(TEST_VERSION_CURRENT, null)).close();
    TaxonomyReader tr1 = new DirectoryTaxonomyReader(dir1);
    TaxonomyReader tr2 = new DirectoryTaxonomyReader(dir2);
    FacetResultsHandler frh1 = fr.createFacetResultsHandler(tr1);
    FacetResultsHandler frh2 = fr.createFacetResultsHandler(tr2);
    assertTrue("should not return the same FacetResultHandler instance for different TaxonomyReader instances", frh1 != frh2);
    tr1.close();
    tr2.close();
    dir1.close();
    dir2.close();
View Full Code Here

    FacetRequest fr = new CountFacetRequest(new CategoryPath("a"), 10);
    Directory dir = newDirectory();
    // create empty indexes, so that LTR ctor won't complain about a missing index.
    new IndexWriter(dir, new IndexWriterConfig(TEST_VERSION_CURRENT, null)).close();
    TaxonomyReader tr = new DirectoryTaxonomyReader(dir);
    FacetResultsHandler frh = fr.createFacetResultsHandler(tr);
    fr.setDepth(10);
    assertEquals(FacetRequest.DEFAULT_DEPTH, frh.getFacetRequest().getDepth());
    tr.close();
    dir.close();
  }
View Full Code Here

TOP

Related Classes of org.apache.lucene.facet.search.FacetResultsHandler

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.