Package com.flaptor.hounder.searcher.filter

Examples of com.flaptor.hounder.searcher.filter.ValueFilter


          if (stringCounter > 2) {
            break;
          }
        }
        if (stringCounter == 2) {
          andedFilter.addFilter(new ValueFilter(s[0], s[1]));
        } else if (stringCounter == 3) {
          andedFilter.addFilter(new RangeFilter(s[0], s[1], s[2]));
        } else {
          String m = "generateFilters: inner list number " + filterCounter + " contains " + stringCounter + " strings.";
          logger.error(m);
View Full Code Here


            andFilter = new BooleanFilter(BooleanFilter.Type.AND);
            for (String categoriesParam : categoriesParams) {
                String[] oredCategories = categoriesParam.split(",");
                BooleanFilter orFilter = new BooleanFilter(BooleanFilter.Type.OR);
                for (String oredCategory : oredCategories) {
                    orFilter.addFilter(new ValueFilter("categories", oredCategory));
                }
                andFilter.addFilter(orFilter);
            }
        }
       
View Full Code Here

  public void testNonMatchingFilters()  throws SearcherException{
    indexer.index(addA);
    indexer.index(addB);
    Execute.sleep(8000);

    AFilter filter = new ValueFilter("nonExistentField", "noValue");
    GroupedSearchResults sr = searcher.search(new MatchAllQuery(), 0, 10, noGroup, 1, filter, null);
    assertEquals(0, sr.totalGroupsEstimation());
  }
View Full Code Here

    indexer.index(addB);
    Execute.sleep(8000);
    GroupedSearchResults sr = searcher.search(new MatchAllQuery(), 0, 10, noGroup, 1, null, null);
    assertEquals(2, sr.totalGroupsEstimation());

    AFilter filter = new ValueFilter("content", "contenta");
    sr = searcher.search(new MatchAllQuery(), 0, 10, noGroup, 1, filter, null);
    assertEquals(1, sr.totalGroupsEstimation());
  }
View Full Code Here

            andFilter = new BooleanFilter(BooleanFilter.Type.AND);
            for (String categoriesParam : categoriesParams) {
                String[] oredCategories = categoriesParam.split(",");
                BooleanFilter orFilter = new BooleanFilter(BooleanFilter.Type.OR);
                for (String oredCategory : oredCategories) {
                    orFilter.addFilter(new ValueFilter("categories", oredCategory));
                }
                andFilter.addFilter(orFilter);
            }
        }

        // Site (uni-valued)
        String siteParam = getParameter(params,"site");
        if (siteParam != null) {
            if (andFilter == null) {
                andFilter = new BooleanFilter(BooleanFilter.Type.AND);
            }
            andFilter.addFilter(new ValueFilter("site", siteParam));
        }

        // Crawl (multi-valued)
        String[] crawlParams = params.get("crawl");
        if (crawlParams != null) {
            if (andFilter == null) {
                andFilter = new BooleanFilter(BooleanFilter.Type.AND);
            }
            for (String crawlParam : crawlParams) {
                String[] oredCrawls = crawlParam.split(",");
                BooleanFilter orFilter = new BooleanFilter(BooleanFilter.Type.OR);
                for (String oredCrawl : oredCrawls) {
                    orFilter.addFilter(new ValueFilter("crawl", oredCrawl));
                }
                andFilter.addFilter(orFilter);
            }
        }
View Full Code Here

TOP

Related Classes of com.flaptor.hounder.searcher.filter.ValueFilter

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.