Examples of FacetSearchParams


Examples of org.apache.lucene.facet.params.FacetSearchParams

  }

  @Override
  public List<FacetResult> accumulate(ScoredDocIDs docids) throws IOException {
    // Replacing the original searchParams with the over-sampled
    FacetSearchParams original = searchParams;
    SampleFixer samplerFixer = sampler.samplingParams.getSampleFixer();
    final boolean shouldOversample = sampler.samplingParams.shouldOverSample();
    if (shouldOversample) {
      searchParams = sampler.overSampledSearchParams(original);
    }
View Full Code Here

Examples of org.apache.lucene.facet.params.FacetSearchParams

  /** since there is a chance that this test would fail even if the code is correct, retry the sampling */
  protected static final int RETRIES = 10;
 
  @Override
  protected FacetSearchParams searchParamsWithRequests(int numResults, FacetIndexingParams fip) {
    FacetSearchParams res = super.searchParamsWithRequests(numResults, fip);
    for (FacetRequest req : res.facetRequests) {
      // randomize the way we aggregate results
      if (random().nextBoolean()) {
        req.setResultMode(ResultMode.GLOBAL_FLAT);
      } else {
View Full Code Here

Examples of org.apache.lucene.facet.params.FacetSearchParams

        initIndex(fip);
        // 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
       
        FacetSearchParams expectedSearchParams = searchParamsWithRequests(K, fip);
        FacetsCollector fc = FacetsCollector.create(expectedSearchParams, indexReader, taxoReader);
       
        searcher.search(q, fc);
       
        List<FacetResult> expectedResults = fc.getFacetResults();
       
        FacetSearchParams samplingSearchParams = searchParamsWithRequests(K, fip);
       
        // 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 {
View Full Code Here

Examples of org.apache.lucene.facet.params.FacetSearchParams

    sp.setSamplingThreshold(50);
    sp.setOversampleFactor(5d);
   
    assertNull("Fixer should be null as the test is for no-fixing",
        sp.getSampleFixer());
    FacetSearchParams fsp = new FacetSearchParams(fip, new CountFacetRequest(
        new CategoryPath("root", "a"), 1));
    SamplingAccumulator accumulator = new SamplingAccumulator(
        new RandomSampler(sp, random()), fsp, indexReader, taxoReader);
   
    // Make sure no complements are in action
View Full Code Here

Examples of org.apache.lucene.facet.params.FacetSearchParams

                          new LongRange("less than 10", 0L, true, 10L, false),
                          new LongRange("less than or equal to 10", 0L, true, 10L, true),
                          new LongRange("over 90", 90L, false, 100L, false),
                          new LongRange("90 or above", 90L, true, 100L, false),
                          new LongRange("over 1000", 1000L, false, Long.MAX_VALUE, false));
    FacetSearchParams fsp = new FacetSearchParams(countRequest, rangeRequest);
   
    final Set<String> dimSeen = new HashSet<String>();

    DrillSideways ds = new DrillSideways(s, tr) {
        @Override
View Full Code Here

Examples of org.apache.lucene.facet.params.FacetSearchParams

                          new LongRange("less than 10", 0L, true, 10L, false),
                          new LongRange("less than or equal to 10", 0L, true, 10L, true),
                          new LongRange("over 90", 90L, false, 100L, false),
                          new LongRange("90 or above", 90L, true, 100L, false),
                          new LongRange("over 1000", 1000L, false, Long.MAX_VALUE, false));
    FacetSearchParams fsp = new FacetSearchParams(countRequest, rangeRequest);
   
    final Set<String> dimSeen = new HashSet<String>();

    DrillSideways ds = new DrillSideways(s, state) {
        @Override
View Full Code Here

Examples of org.apache.lucene.facet.params.FacetSearchParams

      }

      @Override
      public void run() {
        try {
          FacetSearchParams fsp = new FacetSearchParams(iParams, new CountFacetRequest(new CategoryPath("a"), 10),
              new CountFacetRequest(new CategoryPath("b"), 10));
          IndexSearcher searcher = new IndexSearcher(indexReader);
          FacetsCollector fc = FacetsCollector.create(fsp, indexReader, taxoReader);
          searcher.search(new MatchAllDocsQuery(), fc);
          results = fc.getFacetResults();
View Full Code Here

Examples of org.apache.lucene.facet.params.FacetSearchParams

      }

      @Override
      public void run() {
        try {
          FacetSearchParams fsp = new FacetSearchParams(iParams, new CountFacetRequest(new CategoryPath("a"), 10),
              new CountFacetRequest(new CategoryPath("b"), 10));
          IndexSearcher searcher = new IndexSearcher(indexReader);
          FacetsCollector fc = FacetsCollector.create(fsp, indexReader, taxoReader);
          searcher.search(new MatchAllDocsQuery(), fc);
          results = fc.getFacetResults();
View Full Code Here

Examples of org.apache.lucene.facet.params.FacetSearchParams

  @Test
  public void testIntSumAssociation() throws Exception {
    DirectoryTaxonomyReader taxo = new DirectoryTaxonomyReader(taxoDir);
   
    // facet requests for two facets
    FacetSearchParams fsp = new FacetSearchParams(
        new SumIntAssociationFacetRequest(aint, 10),
        new SumIntAssociationFacetRequest(bint, 10));
   
    Query q = new MatchAllDocsQuery();
   
View Full Code Here

Examples of org.apache.lucene.facet.params.FacetSearchParams

  @Test
  public void testFloatSumAssociation() throws Exception {
    DirectoryTaxonomyReader taxo = new DirectoryTaxonomyReader(taxoDir);
   
    // facet requests for two facets
    FacetSearchParams fsp = new FacetSearchParams(
        new SumFloatAssociationFacetRequest(afloat, 10),
        new SumFloatAssociationFacetRequest(bfloat, 10));
   
    Query q = new MatchAllDocsQuery();
   
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.