Package com.browseengine.bobo.docidset

Examples of com.browseengine.bobo.docidset.RandomAccessDocIdSet


    @Override
    public final boolean validate(int docid) throws IOException {
      FacetHitCollector.CurrentPointers miss = null;

      RandomAccessDocIdSet set = _firsttime._currentPointers.docidSet;
      if (set!=null && !set.get(docid))
      {
        miss = _firsttime._currentPointers;
      }

      _nextTarget = docid + 1;
View Full Code Here


    long count = bitset.cardinality();
 
    if (count == 0)
    {
      final DocIdSet empty = EmptyDocIdSet.getInstance();
      return new RandomAccessDocIdSet()
      {
        @Override
        public boolean get(int docId)
        {
          return false;
        }
   
        @Override
        public DocIdSetIterator iterator() throws IOException
        {
          return empty.iterator();
        }        
      };
    }
    else
    {
      return new RandomAccessDocIdSet()
      {
        @Override
        public DocIdSetIterator iterator()
        {
          return new MultiValueOrFacetDocIdSetIterator(dataCache,bitset);
View Full Code Here

  }
 
  @Override
  public RandomAccessDocIdSet getRandomAccessDocIdSet(BoboIndexReader reader) throws IOException
  {
    final RandomAccessDocIdSet innerDocIdSet = _innerFilter.getRandomAccessDocIdSet(reader);
    final DocIdSet notInnerDocIdSet = new NotDocIdSet(innerDocIdSet, reader.maxDoc());
    return new RandomAccessDocIdSet()
    {
      @Override
      public boolean get(int docId)
      {
        return !innerDocIdSet.get(docId);
      }
      @Override
      public DocIdSetIterator iterator() throws IOException
      {
        return notInnerDocIdSet.iterator();
View Full Code Here

    {
      List<DocIdSet> list = new ArrayList<DocIdSet>(_filters.size());
      List<RandomAccessDocIdSet> randomAccessList = new ArrayList<RandomAccessDocIdSet>(_filters.size());
      for (RandomAccessFilter f : _filters)
      {
        RandomAccessDocIdSet s = f.getRandomAccessDocIdSet(reader);
        list.add(s);
        randomAccessList.add(s);
      }
      final RandomAccessDocIdSet[] randomAccessDocIdSets = randomAccessList.toArray(new RandomAccessDocIdSet[randomAccessList.size()]);
      final DocIdSet orDocIdSet = new OrDocIdSet(list);
      return new RandomAccessDocIdSet()
      {
        @Override
        public boolean get(int docId)
        {
          for(RandomAccessDocIdSet s : randomAccessDocIdSets)
          {
            if(s.get(docId)) return true;
          }
          return false;
        }

        @Override
View Full Code Here

 
  @Override
  public RandomAccessDocIdSet getRandomAccessDocIdSet(BoboIndexReader reader)
      throws IOException {
 
      RandomAccessDocIdSet innerDocSet = _facetFilter.getRandomAccessDocIdSet(reader);
      if (innerDocSet==EmptyDocIdSet.getInstance()){
        return innerDocSet;
      }
     
    FacetDataCache dataCache = _facetDataCacheBuilder.build(reader);
View Full Code Here

        for (int docid : docidList){
          if (!deletesPresent  || Arrays.binarySearch(delDocIds,docid) < 0) {
            intArraySet.addDoc(docid);           
          }
        }       
        return new RandomAccessDocIdSet(){
          @Override
          public boolean get(int docid) {
            return docidList.contains(docid);
          }
View Full Code Here

    final int endDocId = endDocIdTemp;
  
    if (startDocId > endDocId) {
      return EmptyDocIdSet.getInstance();
    }
    return new RandomAccessDocIdSet() {
      @Override
      public boolean get(int docId) {       
        return facetPredicate.evaluate(facetDataCache, docId);
      }
      @Override
View Full Code Here

            final int startValue = range[0];
            final int endValue = range[1];
            if (startValue >= endValue) {
              return  EmptyDocIdSet.getInstance();
            }
            return new RandomAccessDocIdSet() {         
                @Override
                public DocIdSetIterator iterator() throws IOException {
                    if (intArray != null) {
                      return new ActivityRangeIntFilterIterator(intArray, indexes, startValue, endValue);          
                    } else {
                      return new ActivityRangeFloatFilterIterator(floatArray, indexes, startValue, endValue);
                    }
                }
                @Override
                public boolean get(int docId) {          
                  if (indexes[docId] == -1) return false;
                  if (intArray != null) {
                    int val = intArray[indexes[docId]];
                    return val >= startValue && val < endValue && val != Integer.MIN_VALUE;
                  }
                  float val = floatArray[indexes[docId]];
                  return val >= startValue && val < endValue && val != Integer.MIN_VALUE;     
                
                }
              };
        } else {
            final long[] longRange = longArray != null ?  parseRawLong(value) : null;
            final long startValue = longRange[0];
            final long endValue = longRange[1];
            if (startValue >= endValue) {
              return  EmptyDocIdSet.getInstance();
            }
        return new RandomAccessDocIdSet() {         
          @Override
          public DocIdSetIterator iterator() throws IOException {
                  return new ActivityRangeLongFilterIterator(longArray, indexes, startValue, endValue)
          }
         
View Full Code Here

  public RandomAccessFilter buildRandomAccessFilter(final String value, final Properties selectionProperty) throws IOException {
    return new RandomAccessFilter() {
      @Override
      public RandomAccessDocIdSet getRandomAccessDocIdSet(final BoboIndexReader reader) throws IOException {
        final RandomAccessDocIdSet docIdSet = (RandomAccessDocIdSet) SynchronizedActivityRangeFacetHandler.super.buildRandomAccessFilter(
            value, selectionProperty).getDocIdSet(reader);
        return new RandomAccessDocIdSet() {
          @Override
          public DocIdSetIterator iterator() throws IOException {
            return new SynchronizedIterator(docIdSet.iterator());
          }

          @Override
          public boolean get(int docId) {
            synchronized (GLOBAL_ACTIVITY_TEST_LOCK) {
              return docIdSet.get(docId);
            }
          }
        };
      }
    };
View Full Code Here

    @Override
    public final boolean validate(int docid) throws IOException {
      FacetHitCollector.CurrentPointers miss = null;

      RandomAccessDocIdSet set = _firsttime._currentPointers.docidSet;
      if (set != null && !set.get(docid)) {
        miss = _firsttime._currentPointers;
      }

      _nextTarget = docid + 1;
View Full Code Here

TOP

Related Classes of com.browseengine.bobo.docidset.RandomAccessDocIdSet

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.