Package com.browseengine.bobo.docidset

Examples of com.browseengine.bobo.docidset.RandomAccessDocIdSet


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

    return selectivity;
  }

  @Override
  public RandomAccessDocIdSet getRandomAccessDocIdSet(BoboSegmentReader 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

    } else {
      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(BoboSegmentReader reader) throws IOException {

    RandomAccessDocIdSet innerDocSet = _facetFilter.getRandomAccessDocIdSet(reader);
    if (innerDocSet == EmptyDocIdSet.getInstance()) {
      return innerDocSet;
    }

    FacetDataCache<?> dataCache = _facetDataCacheBuilder.build(reader);
View Full Code Here

    final BigSegmentedArray orderArray = dataCache.orderArray;

    if (indexes.length == 0) {
      return EmptyDocIdSet.getInstance();
    } else {
      return new RandomAccessDocIdSet() {
        @Override
        public DocIdSetIterator iterator() {
          return new CompactMultiValueFacetDocIdSetIterator(dataCache, indexes, finalBits);
        }
View Full Code Here

    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);
        }
View Full Code Here

    } else {
      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 andDocIdSet = new AndDocIdSet(list);
      return new RandomAccessDocIdSet() {
        @Override
        public boolean get(int docId) {
          for (RandomAccessDocIdSet s : randomAccessDocIdSets) {
            if (!s.get(docId)) return false;
          }
          return true;
        }

        @Override
View Full Code Here

    final int[] latRange = FacetRangeFilter.parse(latDataCache, _latRangeString);
    final int[] longRange = FacetRangeFilter.parse(longDataCache, _longRangeString);
    if ((latRange == null) || (longRange == null)) return null;

    return new RandomAccessDocIdSet() {
      int _latStart = latRange[0];
      int _latEnd = latRange[1];
      int _longStart = longRange[0];
      int _longEnd = longRange[1];
View Full Code Here

    } else {
      final boolean multi = dataCache instanceof MultiValueFacetDataCache;
      final MultiValueFacetDataCache<?> multiCache = multi ? (MultiValueFacetDataCache<?>) dataCache
          : null;

      return new RandomAccessDocIdSet() {
        @Override
        public DocIdSetIterator iterator() {

          if (multi) {
            return new MultiValueORFacetFilter.MultiValueOrFacetDocIdSetIterator(multiCache,
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.