Package org.apache.lucene.search

Examples of org.apache.lucene.search.FilterClause


  {
    for (int i = 0; i < 2; i++) {
      boolean old = (i==0);

      BooleanFilter booleanFilter = new BooleanFilter();
      booleanFilter.add(new FilterClause(getTermsFilter("accessRights", "admin", old),BooleanClause.Occur.MUST));
      tstFilterCard("MUST",3,booleanFilter);
    }
  }
View Full Code Here


  {
    for (int i = 0; i < 2; i++) {
      boolean old = (i==0);

      BooleanFilter booleanFilter = new BooleanFilter();
      booleanFilter.add(new FilterClause(getTermsFilter("inStock","N", old),BooleanClause.Occur.MUST_NOT));
      tstFilterCard("MUST_NOT",4,booleanFilter);
    }
  }
View Full Code Here

  {
    for (int i = 0; i < 2; i++) {
      boolean old = (i==0);

      BooleanFilter booleanFilter = new BooleanFilter();
      booleanFilter.add(new FilterClause(getTermsFilter("inStock","N", old),BooleanClause.Occur.MUST));
      booleanFilter.add(new FilterClause(getTermsFilter("price","030", old),BooleanClause.Occur.MUST_NOT));
      tstFilterCard("MUST_NOT wins over MUST for same docs",0,booleanFilter);
    }
  }
View Full Code Here

      Filter lastFilter = null;
      int count = 0;
      for (Filter filter : filters) {
        if (filter != null) {
          booleanFilter.add(new FilterClause(
              filter, BooleanClause.Occur.SHOULD));
          count += 1;
          lastFilter = filter;
        }
      }
View Full Code Here

    Filter lastFilter = null;
    int count = 0;
    for (Filter filter : filters) {
      if (filter != null) {
        booleanFilter.add(new FilterClause(filter, BooleanClause.Occur.MUST));
        count += 1;
        lastFilter = filter;
      }
    }
View Full Code Here

   * @param filter the filter to return the opposite of
   * @return the negated filter
   */
  public static Filter not(final Filter filter) {
    final BooleanFilter booleanFilter = new BooleanFilter();
    booleanFilter.add(new FilterClause(filter, BooleanClause.Occur.MUST_NOT));
    return booleanFilter;
  }
View Full Code Here

TOP

Related Classes of org.apache.lucene.search.FilterClause

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.