Package com.browseengine.bobo.facets.filter

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


          continue;
        }
       
        FacetHitCollector facetHitCollector = null;

        RandomAccessFilter filter = null;
        if (sel != null)
        {
          filter = handler.buildFilter(sel);
        }
View Full Code Here


    return req;
  }

  public void test1Filter() throws Exception {
    BrowseRequest request = createRequest(1, "prop3");
    RandomAccessFilter randomAccessFilter = attributesFacetHandler.buildFilter(request
        .getSelection(AttributeHandlerName));
    DocIdSetIterator iterator = randomAccessFilter.getDocIdSet(
      boboReader.getSubReaders().get(0).getContext(), null).iterator();
    int docId = iterator.nextDoc();
    int[] docIds = new int[2];
    int i = 0;
    while (docId != DocIdSetIterator.NO_MORE_DOCS) {
View Full Code Here

          continue;
        }

        FacetHitCollector facetHitCollector = null;

        RandomAccessFilter filter = null;
        if (sel != null) {
          filter = handler.buildFilter(sel);
        }

        if (ospec == null) {
View Full Code Here

  public RandomAccessFilter buildFilter(BrowseSelection sel) throws IOException {
    String[] selections = sel.getValues();
    String[] notSelections = sel.getNotValues();
    Properties prop = sel.getSelectionProperties();

    RandomAccessFilter filter = null;
    if (selections != null && selections.length > 0) {
      if (sel.getSelectionOperation() == ValueOperation.ValueOperationAnd) {
        filter = buildRandomAccessAndFilter(selections, prop);
        if (filter == null) {
          filter = EmptyFilter.getInstance();
        }
      } else {
        filter = buildRandomAccessOrFilter(selections, prop, false);
        if (filter == null) {
          return EmptyFilter.getInstance();
        }
      }
    }

    if (notSelections != null && notSelections.length > 0) {
      RandomAccessFilter notFilter = buildRandomAccessOrFilter(notSelections, prop, true);
      if (filter == null) {
        filter = notFilter;
      } else {
        RandomAccessFilter andFilter = new RandomAccessAndFilter(
            Arrays.asList(new RandomAccessFilter[] { filter, notFilter }));
        filter = andFilter;
      }
    }
View Full Code Here

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

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

  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

        BoboIndexReader boboReader = (BoboIndexReader)reader;
        TermDocs termDocs = boboReader.termDocs(null);
        FacetHandler<?> fhandler = boboReader.getFacetHandler(FacetTermQuery.this._name);
        if (fhandler!=null){
         DocIdSetIterator dociter = null;
         RandomAccessFilter filter = fhandler.buildFilter(FacetTermQuery.this._sel);
         if (filter!=null){
           RandomAccessDocIdSet docset =filter.getRandomAccessDocIdSet(boboReader);
           if (docset!=null){
             dociter = buildIterator(docset, termDocs);
           }
         }
         if (dociter==null){
View Full Code Here

  {
      String[] selections = sel.getValues();
      String[] notSelections = sel.getNotValues();
      Properties prop=sel.getSelectionProperties();
     
      RandomAccessFilter filter = null;
      if (selections!=null && selections.length > 0)
      {
        if (sel.getSelectionOperation() == ValueOperation.ValueOperationAnd)
        {
          filter = buildRandomAccessAndFilter(selections,prop);
          if (filter == null)
          {
            filter = EmptyFilter.getInstance();
          }
        }
        else
        {
          filter = buildRandomAccessOrFilter(selections, prop,false);
          if (filter == null)
          {
            return EmptyFilter.getInstance();
          }
        }
      }
     
      if (notSelections!=null && notSelections.length>0)
      {
        RandomAccessFilter notFilter = buildRandomAccessOrFilter(notSelections, prop, true);
        if (filter==null)
        {
          filter = notFilter;
        }
        else
        {
          RandomAccessFilter andFilter = new RandomAccessAndFilter(Arrays.asList(new RandomAccessFilter[]{filter,notFilter}));
          filter = andFilter;
        }
      }
     
      return filter;
View Full Code Here

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

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

    {
      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
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.