Package com.browseengine.bobo.util

Examples of com.browseengine.bobo.util.BigNestedIntArray$BufferedLoader


  protected boolean _overflow = false;
 
  public MultiValueFacetDataCache()
  {
    super();
    _nestedArray = new BigNestedIntArray();
  }
View Full Code Here


    @Override
    public RandomAccessDocIdSet getRandomAccessDocIdSet(BoboIndexReader reader) throws IOException {     
      final MultiValueFacetDataCache dataCache = multiDataCacheBuilder.build(reader)
      final int index = dataCache.valArray.indexOf(_val);
        final BigNestedIntArray nestedArray = dataCache._nestedArray;
        if(index < 0)
        {
            return EmptyDocIdSet.getInstance();
        }
        else
        {
            return new RandomAccessDocIdSet()
            {
                @Override
                public DocIdSetIterator iterator()
                {
                    return new MultiValueFacetDocIdSetIterator(dataCache, index);
                }
            @Override
            final public boolean get(int docId)
            {
              return nestedArray.contains(docId, index);
            }
               
            };
        }
    }
View Full Code Here

  public RandomAccessDocIdSet getRandomAccessDocIdSet(final BoboIndexReader reader) throws IOException
  {     
    final FacetDataCache dataCache = _facetHandler.getFacetData(reader);

    final boolean multi = dataCache instanceof MultiValueFacetDataCache;   
    final BigNestedIntArray nestedArray = multi ? ((MultiValueFacetDataCache) dataCache)._nestedArray : null;
    final int[] range = parse(dataCache,_rangeString);
   
    if (range == null) return null;
   
    if (range[0]>range[1]){
      return EmptyDocIdSet.getInstance();
    }
   
    if (range[0] == range[1] && range[0]<0){
    return EmptyDocIdSet.getInstance();
    }
   
    return new RandomAccessDocIdSet()
    {
      int _start = range[0];
      int _end = range[1];
     
      @Override
      final public boolean get(int docId)
      {
        if (multi) {
          nestedArray.containsValueInRange(docId, _start, _end);
        }
        int index = dataCache.orderArray.get(docId);       
        return index >= _start && index <= _end;
      }
View Full Code Here

    @Override
    public RandomAccessDocIdSet getRandomAccessDocIdSet(BoboIndexReader reader) throws IOException {
      final MultiValueFacetDataCache dataCache = _facetHandler.getFacetData(reader);
        final int index = dataCache.valArray.indexOf(_val);
        final BigNestedIntArray nestedArray = dataCache._nestedArray;
        if(index < 0)
        {
            return EmptyDocIdSet.getInstance();
        }
        else
        {
            return new RandomAccessDocIdSet()
            {
                @Override
                public DocIdSetIterator iterator()
                {
                    return new MultiValueFacetDocIdSetIterator(dataCache, index);
                }
            @Override
            final public boolean get(int docId)
            {
              return nestedArray.contains(docId, index);
            }
               
            };
        }
    }
View Full Code Here

  private boolean _overflow = false;
 
  public MultiValueFacetDataCache()
  {
    super();
    _nestedArray = new BigNestedIntArray();
  }
View Full Code Here

  @Override
  public RandomAccessDocIdSet getRandomAccessDocIdSet(BoboIndexReader reader) throws IOException
  {
    final MultiValueFacetDataCache dataCache = (MultiValueFacetDataCache)_facetHandler.getFacetData(reader);
    final int[] index = _valueConverter.convert(dataCache, _vals);
    final BigNestedIntArray nestedArray = dataCache._nestedArray;
    final OpenBitSet bitset = new OpenBitSet(dataCache.valArray.size());
 
    for (int i : index)
    {
      bitset.fastSet(i);
    }
 
    if (_takeCompliment)
    {
      // flip the bits
      int size = dataCache.valArray.size();
      for (int i=0;i<size;++i){
        bitset.fastFlip(i);
      }
    }
 
    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);
        }

        @Override
        final public boolean get(int docId)
        {
          return nestedArray.contains(docId,bitset);
        }
      };
    }
  }
View Full Code Here

  public final BigNestedIntArray _weightArray;

  public MultiValueWithWeightFacetDataCache() {
    super();
    _weightArray = new BigNestedIntArray();
  }
View Full Code Here

  protected int _maxItems = BigNestedIntArray.MAX_ITEMS;
  protected boolean _overflow = false;

  public MultiValueFacetDataCache() {
    super();
    _nestedArray = new BigNestedIntArray();
  }
View Full Code Here

  public RandomAccessDocIdSet getRandomAccessDocIdSet(final BoboSegmentReader reader)
      throws IOException {
    final FacetDataCache<?> dataCache = _facetHandler.getFacetData(reader);

    final boolean multi = dataCache instanceof MultiValueFacetDataCache;
    final BigNestedIntArray nestedArray = multi ? ((MultiValueFacetDataCache<?>) dataCache)._nestedArray
        : null;
    final int[] range = parse(dataCache, _rangeString);

    if (range == null) {
      return null;
    }

    if (range[0] > range[1]) {
      return EmptyDocIdSet.getInstance();
    }

    return new RandomAccessDocIdSet() {
      int _start = range[0];
      int _end = range[1];

      @Override
      final public boolean get(int docId) {
        if (multi) {
          nestedArray.containsValueInRange(docId, _start, _end);
        }
        int index = dataCache.orderArray.get(docId);
        return index >= _start && index <= _end;
      }
View Full Code Here

  public RandomAccessDocIdSet getRandomAccessDocIdSet(BoboSegmentReader reader) throws IOException {
    @SuppressWarnings("unchecked")
    final MultiValueFacetDataCache<String> dataCache = (MultiValueFacetDataCache<String>) _facetHandler
        .getFacetData(reader);
    final int[] index = _valueConverter.convert(dataCache, _vals);
    final BigNestedIntArray nestedArray = dataCache._nestedArray;
    final OpenBitSet bitset = new OpenBitSet(dataCache.valArray.size());

    for (int i : index) {
      bitset.fastSet(i);
    }

    if (_takeCompliment) {
      // flip the bits
      int size = dataCache.valArray.size();
      for (int i = 0; i < size; ++i) {
        bitset.fastFlip(i);
      }
    }

    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);
        }

        @Override
        final public boolean get(int docId) {
          return nestedArray.contains(docId, bitset);
        }
      };
    }
  }
View Full Code Here

TOP

Related Classes of com.browseengine.bobo.util.BigNestedIntArray$BufferedLoader

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.