Package com.browseengine.bobo.facets.filter

Examples of com.browseengine.bobo.facets.filter.RandomAccessFilter


  public RandomAccessFilter buildRandomAccessOrFilter(String[] vals, Properties prop, boolean isNot)
      throws IOException {
    ArrayList<RandomAccessFilter> filterList = new ArrayList<RandomAccessFilter>(vals.length);

    for (String val : vals) {
      RandomAccessFilter f = buildRandomAccessFilter(val, prop);
      if (f != null && !(f instanceof EmptyFilter)) {
        filterList.add(f);
      }
    }

    RandomAccessFilter finalFilter;
    if (filterList.size() == 0) {
      finalFilter = EmptyFilter.getInstance();
    } else {
      finalFilter = new RandomAccessOrFilter(filterList);
    }
View Full Code Here


    ArrayList<RandomAccessFilter> filterList = new ArrayList<RandomAccessFilter>(vals.length);

    for (String val : vals)
    {
      RandomAccessFilter f = buildRandomAccessFilter(val, prop);
      if(f != null)
      {
        filterList.add(f);
      }
      else
View Full Code Here

  }

  @Override
  public RandomAccessFilter buildRandomAccessOrFilter(String[] vals,Properties prop,boolean isNot) throws IOException
  {
    RandomAccessFilter filter = null;
    if (vals.length > 1)
    {
      MultiValueORFacetFilter f = new MultiValueORFacetFilter(this,vals,false);      // catch the "not" case later
      if (!isNot) {
        AdaptiveFacetFilter af = new AdaptiveFacetFilter(new SimpleDataCacheBuilder(getName(), _indexFieldName), f, vals, false);
View Full Code Here

  {
    ArrayList<RandomAccessFilter> filterList = new ArrayList<RandomAccessFilter>(vals.length);
   
    for (String val : vals)
    {
      RandomAccessFilter f = buildRandomAccessFilter(val, prop);
      if(f != null)
      {
        filterList.add(f);
      }
      else
View Full Code Here

  }
 
  @Override
  public RandomAccessFilter buildRandomAccessOrFilter(String[] vals,Properties prop,boolean isNot) throws IOException
  {
    RandomAccessFilter filter = null;
   
    if(vals.length > 0)
    {
      filter = new CompactMultiValueFacetFilter(this,vals);
    }
View Full Code Here

  }

  @Override
  public RandomAccessFilter buildRandomAccessOrFilter(String[] vals,Properties prop,boolean isNot) throws IOException
  {
    RandomAccessFilter filter = null;
   
    if(vals.length > 1)
    {
      RandomAccessFilter f = new FacetOrFilter(this,vals,false);
      filter = new AdaptiveFacetFilter(new FacetDataCacheBuilder(){

      @Override
      public FacetDataCache build(BoboIndexReader reader) {
        return  getFacetData(reader);
View Full Code Here

      throws IOException {
    if (vals.length > 1) {
      return new BitSetFilter(new ValueConverterBitSetBuilder(FacetRangeValueConverter.instance,
          vals, isNot), new SimpleDataCacheBuilder(getName(), _indexFieldName));
    } else {
      RandomAccessFilter filter = buildRandomAccessFilter(vals[0], prop);
      if (filter == null) return filter;
      if (isNot) {
        filter = new RandomAccessNotFilter(filter);
      }
      return filter;
View Full Code Here

      throws IOException {
    List<RandomAccessFilter> filterList = new LinkedList<RandomAccessFilter>();
    FacetHandler<FacetDataCache<?>> dependOnFacetHandler = (FacetHandler<FacetDataCache<?>>) getDependedFacetHandler(_dependsOnFacetName);
    for (String bucketString : bucketStrings) {
      String[] vals = _predefinedBuckets.get(bucketString);
      RandomAccessFilter filter = dependOnFacetHandler.buildRandomAccessOrFilter(vals, prop, false);
      if (filter == EmptyFilter.getInstance()) return EmptyFilter.getInstance();
      filterList.add(filter);
    }
    if (filterList.size() == 0) return EmptyFilter.getInstance();
    if (filterList.size() == 1) return filterList.get(0);
View Full Code Here

  @SuppressWarnings("unchecked")
  @Override
  public RandomAccessFilter buildRandomAccessOrFilter(String[] bucketStrings, Properties prop,
      boolean isNot) throws IOException {
    if (isNot) {
      RandomAccessFilter excludeFilter = buildRandomAccessAndFilter(bucketStrings, prop);
      return new RandomAccessNotFilter(excludeFilter);
    } else {
      FacetHandler<FacetDataCache<?>> dependOnFacetHandler = (FacetHandler<FacetDataCache<?>>) getDependedFacetHandler(_dependsOnFacetName);

      Set<String> selections = new HashSet<String>();
View Full Code Here

  public RandomAccessFilter buildRandomAccessAndFilter(String[] vals, Properties prop)
      throws IOException {
    if (vals.length > 1) {
      return EmptyFilter.getInstance();
    } else {
      RandomAccessFilter f = buildRandomAccessFilter(vals[0], prop);
      if (f != null) {
        return f;
      } else {
        return EmptyFilter.getInstance();
      }
View Full Code Here

TOP

Related Classes of com.browseengine.bobo.facets.filter.RandomAccessFilter

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.